tags:

views:

88

answers:

1

Hi all,

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?

Thanks, Erik

A: 

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.

Qberticus
Works great, thanks!
Erik
New problem: How do I get the 'height' of the full content that scrolls? I have the current position now, but I want to tell how 'far' the scrollbar is. getHeight() doesn't return correct values, probably the height on screen and not of the content.
Erik
Use getHeight on the child view that you put into the ScrollView. ScrollView works basically by telling the child view be as large as it wants and then acts as a viewport to it.
Qberticus