问题
I'm using a MergeAdapter (from Mark Murphy's excellent series of projects). You use it with a ListView. I'm trying to rebuild the contents of the adapter on a refresh (instead of refreshing "in place" and calling notifyDataSetChange()).
I'd like to get the y-scroll value of the listview so I can reset to that after I rebuild my list. This doesn't seem to be possible?
Thanks
回答1:
Implement OnScrollListener for your listview.
@Override
public void onScroll(AbsListView absListView, int firstVisible, int visibleCount, int totalCount) {
//firstvisible is your first visible item in the list
}
来源:https://stackoverflow.com/questions/10865150/listview-get-scroll-position