您的位置:首页 > 其它

ListView判断滑动底部

2015-09-26 10:46 281 查看
通过实现OnScrollListener这个接口,然后复写

public abstract void onScroll (AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount)

Since: API Level 1

Callback method to be invoked when the list or grid has been scrolled. This will be called after the scroll has completed

Parameters
viewThe view whose scroll state is being reported
firstVisibleItemthe index of the first visible cell (ignore if visibleItemCount == 0)
visibleItemCountthe number of visible cells
totalItemCountthe number of items in the list adaptor
@Override
public void onScroll(AbsListView view, int firstVisibleItem,
int visibleItemCount, int totalItemCount) {
}


这个方法,firstVisibleItem + visibleItemCount 等于 totalItemCount 的时候那么就说明滑动到底部了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: