[英]How can I detect if the user is scrolling up when the listview has already reached the top
How can I test if the user is scrolling up while the ListView
is already all the way up? 如何在
ListView
一直向上的同时测试用户是否在向上滚动?
answersListView.setOnScrollListener(new OnScrollListener() {
@Override
public void onScrollStateChanged(AbsListView view,int scrollState){
// TODO Auto-generated method stub
}
@Override
public void onScroll(AbsListView view,int firstVisibleItem, int visibleItemCount,
int totalItemCount) {
// TODO Auto-generated method stub
}
});
look at android-pulltorefresh , specifically at onTouchEvent
and on both onScroll
and onScrollStateChanged
methods. 查看android-pulltorefresh ,特别是
onTouchEvent
以及onScroll
和onScrollStateChanged
方法。 Basically, you should have onTouchEvent
基本上,您应该具有
onTouchEvent
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.