android - List view's getChildCount method does not return an accurate count of the number of visible items -


i need able tell items in list view visible. "visibleitemcount" term in onscroll , listview.getchildcount both return values typically 1-3 higher should based on visible on screen. items not same height might play role in throwing off.

what best way more accurate reading of visible?

the method getchildcount() not supposed return count of visible childs but, docs :

returns number of children in group.

to number of visible items should using getlastvisibleposition() , getfirstvisibleposition() :

int visiblechildscount=lv.getlastvisibleposition()-lv.getfirstvisibleposition(); 

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -