今天同事问了我一个关于ListView的问题,设置完ItemClickListener之后想要部分内容可以点击部分内容不可以点击,看了一下他使用的adapter是BaseAdapter,然后去查找了一下SDK,其中有一个函数
boolean isEnabled(int position)
Returns true if the item at the specified position is not a separator.
public boolean isEnabled (int position)
Since: API Level 1
Returns true if the item at the specified position is not a separator. ([color=red]A separator is a non-selectable, non-clickable item[/color]). The result is unspecified if position is invalid. An ArrayIndexOutOfBoundsException should be thrown in that case for fast failure.
Parameters
position Index of the item
Returns
True if the item is not a separator
问题顺利解决
boolean isEnabled(int position)
Returns true if the item at the specified position is not a separator.
public boolean isEnabled (int position)
Since: API Level 1
Returns true if the item at the specified position is not a separator. ([color=red]A separator is a non-selectable, non-clickable item[/color]). The result is unspecified if position is invalid. An ArrayIndexOutOfBoundsException should be thrown in that case for fast failure.
Parameters
position Index of the item
Returns
True if the item is not a separator
问题顺利解决