安卓:滚动型“setOnScrollListener”(如ListView控件) [英] Android: ScrollView 'setOnScrollListener' (like ListView)
问题描述
我想要做的事情,当用户滚动> 90%了,所以我想我可能只是增加一个onScrollListener就像我会在一个ListView。不幸的是,滚动型似乎并不有一个类似的方法。有什么办法,我可以做我想做的;得到一个通知,当用户滚动约90%下降?
I want to do something when the user has scrolled >90% down, so I thought I could just add a onScrollListener like I would in a ListView. Unfortunatly, ScrollView doesn't seem to have a similar method. Is there any way I can do what I want; getting a notification when the user scrolls approx 90% down?
谢谢, 埃里克
推荐答案
您可以尝试延长滚动型
并覆盖查看#onScrollChanged
和做你检查那里。你必须扩展滚动型
,因为 onScrollChanged
是一个受保护的方法。
You can try extending ScrollView
and overriding View#onScrollChanged
and the doing your checks there. You have to extend ScrollView
since onScrollChanged
is a protected method.
这篇关于安卓:滚动型“setOnScrollListener”(如ListView控件)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!