[英]Android simultaneously use Pull to Refresh ListView at the top and automatically Load more data when scroll to the Bottom
Please read it carefully before marking it as duplicate . 在将其标记为重复之前,请仔细阅读。 I am using pulltorefresh from this library and I am implimenting pulltorefresh on the top of screen using following code:
我正在使用此库中的 pulltorefresh,并且使用以下代码在屏幕顶部隐含了pulltorefresh:
listView.setMode(Mode.PULL_FROM_START);
Now i also want to use ListView automatically Load more data when scroll to the Bottom of the screen. 现在我也想使用ListView滚动到屏幕底部时自动加载更多数据。 Is it possible with using pulltorefresh library?
使用pulltorefresh库是否可能? If not please help me to solve this problem.
如果没有,请帮助我解决此问题。
Thanks in advance. 提前致谢。
set OnScrollListener
listener to your ListView
. 将
OnScrollListener
侦听器设置为ListView
。 Based on number of items displayed, get new rows from web(Asynchronously) and add them to ArrayList(or whatever you are using to populate your list) and call notifyDataSetChanged()
. 根据显示的项目数,从web(异步)获取新行,并将其添加到ArrayList(或用于填充列表的任何行),然后调用
notifyDataSetChanged()
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.