简体   繁体   English

Android同时使用顶部的Pull to Refresh ListView并在滚动到底部时自动加载更多数据

[英]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.

相关问题 Android ListView 滚动到顶部时自动加载更多数据 - Android ListView automatically Load more data when scroll to the top Android listview 滚动到底部以从 sqlite 加载更多数据 - Android listview scroll to bottom to load more data from sqlite 当位于底部时,Android自动在列表视图中加载更多项目 - Android automatically load more items in listview when at the bottom 具有拉动刷新和加载更多功能的Android ListView-不建议弃用((?) - Android ListView with Pull to Refresh & Load more - that is not deprecated!(?) 在pull上加载更多数据以在listview中刷新 - load more data on pull to refresh in listview ListView在滚动底部加载更多 - ListView load more on scroll bottom 滚动到底部时加载更多数据 - Load more data when Scroll reaches bottom 在Android中向上滚动列表视图时,隐藏“拉动刷新”视图 - Hide “pull to refresh” view when scroll up the listview in Android Titanium Appcelerator拉动可在iOS和Android滚动条上刷新加载数据 - Titanium appcelerator pull to refresh load data on scroll iOS and Android Android-在列表视图中滚动底部时,从mysql数据库中查看更多旧数据(不是图像) - Android - view more old data (not image) from mysql database, When scroll bottom in listview
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM