为什么listview.getChildCount()
和adapter.getCount()
返回不同的值?我有一个onScroll方法,在其中,如果我调用上述方法,则每个方法都会返回不同的值。有人知道为什么吗?
ListView.getChildCount()
返回Views
屏幕上的数字。Adapter
sgetCount()
返回列表中对象的总数。
您可能String
说了50秒,ArrayAdapter
但当前在屏幕上只绘制了10秒,因此您的ListView
数量为10,但您的Adapter
数量为50。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句