ihrupin ihrupin - 1 year ago 263
Android Question

Android: How to scroll ScrollView in top

I have two buttons that switching to the next list of events and the previous one.

When I go to next\previous event, scrolls remains somewhere below. But I need to "rewind" it up.

I'm trying:



scrollViewEventDetails.scrollTo(0, 0);

but it doesn't work. Please, help!

Answer Source

You shoud write next:

scrollViewEventDetails.fullScroll(View.FOCUS_UP);//if you move at the end of the scroll

scrollViewEventDetails.pageScroll(View.FOCUS_UP);//if you move at the middle of the scroll
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download