[英]How can I detect when a scrollview has reached the bottom so that I can load more items into it?
I have a scrollview in my android application that I fill with Items from a database. 我在android应用程序中有一个scrollview,我用数据库中的Items填充了它。 I start off with 20 items in it, but what I want to happen is for the scrollview to load more items when the user pulls the scrollview up when it is at the bottom.
我开始时有20个项目,但是我想发生的是,当用户在底部滚动视图时将其向上拉时,scrollview会加载更多项目。 I could override onDetectOverflow if it weren't private but I cannot so I can't figure out how to detect when the user is pulling the scrollview up.
如果onDetectOverflow不是私有的,我可以覆盖它,但是我不能这样做,所以我不知道如何检测用户何时向上拖动scrollview。 There doesnt seem to be any onScroll Listener I can use so does anyone have a way I can detect this?
我似乎没有可以使用的任何onScroll Listener,所以有人可以检测到吗?
You can use PullToRefresh listview for your requirement. 您可以根据需要使用PullToRefresh列表视图。 It will load data for both scrollview up and scrollview down according to the user scrolling.. The following link provides the source of PullToRefresh listview
它将根据用户滚动加载向上滚动视图和向下滚动视图的数据。以下链接提供了PullToRefresh listview的源
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.