AdapterView(Gallery、ListView、GridView) 調用了getCount 方法但是沒有調用getView方法


http://hi.baidu.com/dean_wang/blog/item/a1997b714646bd018601b043.html

通常AdapterView會在調用getCount 方法之後調用getView方法來獲取根據Adapter數據生成的子View進行繪製,但是如果getCount返回0或負數,那麼Adapter 的getView方法將不被調用;

另外,如果錯誤地調用了Adapter的notifyDataSetInvalidated方法,會導致即使在getCount函數返回大於0的情況下,getView函數仍然不被調用。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章