AdapterView(Gallery、ListView、GridView) 调用了getCount 方法但是没有调用getView方法
2011-11-28 18:11
513 查看
http://hi.baidu.com/dean_wang/blog/item/a1997b714646bd018601b043.html
通常AdapterView会在调用getCount 方法之后调用getView方法来获取根据Adapter数据生成的子View进行绘制,但是如果getCount返回0或负数,那么Adapter 的getView方法将不被调用;
另外,如果错误地调用了Adapter的notifyDataSetInvalidated方法,会导致即使在getCount函数返回大于0的情况下,getView函数仍然不被调用。
通常AdapterView会在调用getCount 方法之后调用getView方法来获取根据Adapter数据生成的子View进行绘制,但是如果getCount返回0或负数,那么Adapter 的getView方法将不被调用;
另外,如果错误地调用了Adapter的notifyDataSetInvalidated方法,会导致即使在getCount函数返回大于0的情况下,getView函数仍然不被调用。
相关文章推荐
- ListView和GridView 自定义Adapter的getView()方法调用问题
- Android listview&gridview getview 方法多次调用问题解决方法 并附上单页加载实现问卷调查适配器源代码
- ListView GridView,ViewpAger等的getView方法调用多次
- listview绑定数据没有调用getview方法
- listview的getCount不等于0,但是却不走getView方法
- android ListView 和Adapter 结合,但是不调用getView()方法??
- Android listview&gridview getview 方法多次调用问题解决方法--->导致gridview错位
- Android listview&gridview getview 方法多次调用问题解决方法
- Android listview&gridview getview 方法多次调用问题解决方法
- Android ListView反复调用getView和getCount
- 彻底解决listview,gridview的getview多次调用问题
- Android中的GridView反复调用getView和getCount,并且getView中的position的值几乎都是0
- Android自定义ListView或GridView适配器Adapter的getView方法不执行的问题
- ListView和GridView多次调用GetView的现象和解决办法
- users实体类包括调用DBHelper中的各种方法,但是没有返回DataTable的方法
- Android ListView反复调用getView和getCount
- Android ListView反复调用getView和getCount
- GridView重复调用getView()方法处理方法
- 【Android】 ListView中getView的原理与解决多轮重复调用的方法
- Android ListView反复调用getView和getCount