ListView get scroll position?

a 夏天 提交于 2019-12-08 19:47:31

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!