向 ListView 添加一行以显示“正在加载”下载信息时。就像在市场上一样
我已经尝试过,但没有运气试图在其他地方找到这个答案。
我想在列表视图的底部添加一行,显示“正在加载...”,也许还有一个旋转的进度指示器。
一旦用户滚动到底部,我的程序就已经将附加信息加载到列表视图中。但我希望用户能够看到程序确实正在加载某些内容。
示例:如果您转到 android 市场并滚动到其中一个列表的底部,最后一行将显示“正在加载...”。然后,一旦加载数据,该栏就会被新数据的第一项替换。
抱歉,有点难以描述。我不想在列表视图的底部添加页脚。我希望它成为列表视图中的实际项目。
I've tried, but have had no luck trying to find this answer elsewhere.
I want to add a row to the bottom of my listview that displays "Loading..." and maybe a spinning progress indicator.
My program already loads additional information into the listview once the user scrolls to the bottom. But I want the user to be able to see that the program is indeed loading something.
Example: If you go to the android marketplace and scroll to the bottom of one of the lists, the last row will say "Loading...". Then once the data is loaded, that bar is replaced with the first item of the new data.
Sorry, it's a little hard to describe. I am NOT trying to add a footer to the bottom of the list view. I want it to be an actual item in the listview.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看看下面的库:
https://github.com/commonsguy/cwac-endless
它完全符合您的要求因为它也非常容易使用。
我自己在我的一款应用程序上使用过它:WorldSpeak。看一下它就可以看到结果。
Take a look at the following library:
https://github.com/commonsguy/cwac-endless
It does exactly what you're looking for and it's also very easy to use.
I've used it myself on one of my apps: WorldSpeak. Take a look on it to see the result.
假设列表项中有一个 TextView,您可以将一个新项目添加到列表末尾,显示“正在加载...”,然后在更新列表时删除该项目。即,如果“hashlist”包含适配器中声明的数据,
Assuming you have a TextView in the list items, you could add a new item to the end of the list that says "Loading..." and then remove that item when you update the list. I.e., if "hashlist" contains the data as declared in the adapter,