ListView自定义后,在onItemClick中getChildAt返回null问题
来源:互联网 发布:ee域名续费 编辑:程序博客网 时间:2024/05/02 00:29
本文地址:http://blog.csdn.net/you_and_me12/article/details/7271006
在ListView中,使用getChildAt(index)的取值,只能是当前可见区域(列表可滚动)的子项!
1、所以如果想获取前部的将会出现返回Null值问题;
2、getChildCount跟getCount获取的值将会不一样(数量多时);
3、如果使用了getChildAt(index).findViewById(...)设置值的话,滚动列表时值就会改变了。需要使用getFirstVisiblePosition()获得第一个可见的位置,在用当前的position-它,在用getChildAt取值!
都是文字,不贴代码了。
版权声明:本文为博主原创文章,未经博主允许不得转载。
0 0
- ListView自定义后,在onItemClick中getChildAt返回null问题
- ListView自定义后,在onItemClick中getChildAt返回null问题
- ListView自定义后,在onItemClick中getChildAt返回null问题
- 解决Android中GridView、ListView的getChildAt方法返回null的问题
- Android中GridView、ListView的getChildAt方法返回null
- 【转】Android中GridView、ListView的getChildAt方法返回null
- Android中GridView、ListView的getChildAt方法返回null
- Android中GridView、ListView 的 getChildAt() 方法返回null 解决方案
- 解决OnscrollListener中Listview.getChildAt()为null问题
- Android 中Listview方法getChildAt()返回为空的问题
- Android ListView、GridView中getChildAt返回值不正确的问题
- 解决ListView中getChildAt(int index)获取item的view为null的问题
- Android ListView.getChildAt(index)==null
- ListView getChildAt()为空问题
- Listview 中 getChildAt方法记录
- Android中自定义ListView无法响应OnItemClickListener中的onItemClick方
- ListView getChildAt
- 解决 ListView的Item里TextView设置超链接后ListView 的OnItemClick失效的问题
- ubuntu没有开启cron日志
- m
- android开发知识块总结
- 非常不错的session介绍
- 异常处理----Throwable类
- ListView自定义后,在onItemClick中getChildAt返回null问题
- 个人电脑端口完全解析
- ACE_Reactor(一)整体理解ACE_Reactor
- overflow(2)
- 据说这是最全的互联网工具集(转)
- Spring基础
- Linux设备驱动开发基础之互斥与同步基础
- 1169 传纸条
- Windows安装Python图像处理库:PIL模块