简体   繁体   中英

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?

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. Basically, you should have onTouchEvent

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM