首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

Android中BaseAdapter的一部分点击事件

2012-07-02 
Android中BaseAdapter的部分点击事件今天同事问了我一个关于ListView的问题,设置完ItemClickListener之后

Android中BaseAdapter的部分点击事件
今天同事问了我一个关于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. (A separator is a non-selectable, non-clickable item). The result is unspecified if position is invalid. An ArrayIndexOutOfBoundsException should be thrown in that case for fast failure.
Parameters

positionIndex of the item
Returns

True if the item is not a separator

问题顺利解决

热点排行