ListView中获得滚动位置? [英] ListView get scroll position?

查看:85
本文介绍了ListView中获得滚动位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是MergeAdapter(马克·墨菲的出色一系列的项目)。你跟一个ListView使用它。我试图重建在刷新适配器的内容(而不是提神到位,并呼吁notifyDataSetChange())。

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()).

我想获得列表视图的y滚动值,所以我可以重置后,我重建我的名单。这似乎并不可能吗?

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?

感谢

推荐答案

实施OnScrollListener您的列表视图。

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
}

这篇关于ListView中获得滚动位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆