码迷,mamicode.com
首页 > 其他好文 > 详细

ListView判断滑动底部

时间:2015-09-26 11:52:39      阅读:114      评论:0      收藏:0      [点我收藏+]

标签:

通过实现OnScrollListener这个接口,然后复写

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

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

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

这个方法,firstVisibleItem + visibleItemCount 等于 totalItemCount 的时候那么就说明滑动到底部了。

ListView判断滑动底部

标签:

原文地址:http://www.cnblogs.com/Sunnor/p/4840406.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!