ListView中的onItemClick无法被响应
2016-07-06 15:40
330 查看
按照网上绝大多数人的说法,基本都是如下解决方案:
http://www.cnblogs.com/ycxyyzw/p/3672366.html
但是我的listview就是死活不能被点击,最后一点点删代码,发现BaseAdapter的isEnabled代码引发的问题,我直接全部返回false了。
如下copy官方解释:
isEnabled
Added in 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
be thrown in that case for fast failure.
也就是说,这个函数是为了区分隔离符号和真正item的,如果是隔离符号返回false,如果是item返回true。这样隔离符号不能被点击,但是item可以被点击。
我直接所有都返回false,导致他们都不能被点击了。
http://www.cnblogs.com/ycxyyzw/p/3672366.html
但是我的listview就是死活不能被点击,最后一点点删代码,发现BaseAdapter的isEnabled代码引发的问题,我直接全部返回false了。
如下copy官方解释:
isEnabled
Added in API level 1
boolean isEnabled (int position)
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
ArrayIndexOutOfBoundsExceptionshould
be thrown in that case for fast failure.
Parameters | |
---|---|
position | int: Index of the item |
Returns | |
---|---|
boolean | True if the item is not a separator |
我直接所有都返回false,导致他们都不能被点击了。
相关文章推荐
- 完美实现Android ListView中的TextView的跑马灯效果
- android上改变listView的选中颜色
- Delphi7中Listview的常用功能汇总
- Delphi控件ListView的属性及使用方法详解
- Android ListView弹性效果的实现方法
- android中ListView数据刷新时的同步方法
- Android提高之ListView实现自适应表格的方法
- Android中实现水平滑动(横向滑动)ListView示例
- Android ListView分页功能实现方法
- C#实现ListView选中项向上或向下移动的方法
- C#下listview如何插入图片
- Listview加载的性能优化是如何实现的
- C#实现listview Group收缩扩展的方法
- C# listview添加combobox到单元格的实现代码
- ListView 百分比进度条(delphi版)
- Android listview多视图嵌套多视图
- ListView Adapter优化 实例
- Android用ListView显示SDCard文件列表的小例子
- Adapter实现ListView带多选框等状态的自定义控件的注意事项
- asp.net ListView 数据绑定