android listview判断是否滑动到顶部还是底部
listView.setOnScrollListener(new AbsListView.OnScrollListener() { @Override public void onScrollStateChanged(AbsListView view, int scrollState) { } @Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { if (firstVisibleItem == 0) { Toast.makeText(MyActivity.this, "滑到顶部",1).show(); } if (visibleItemCount + firstVisibleItem == totalItemCount) { Toast.makeText(MyActivity.this, "滑到底部",1).show(); } } });
本文出自 无忧之路 - 博客园