How can i make it once the ScrollView is out of the screen it will auto scroll to the bottom?
Asked
Active
Viewed 8,963 times
5
Edric
- 21,480
- 12
- 75
- 86
user1239315
- 75
- 1
- 11
-
See http://stackoverflow.com/questions/3307267/how-to-scroll-to-bottom-in-a-scrollview-on-activity-startup – Clément Mar 05 '12 at 15:09
3 Answers
7
Try below code to achieve your task :-
scroll.fullScroll(View.FOCUS_DOWN);
or
ScrollView sv = (ScrollView)findViewById(R.id.scrl);
sv.scrollTo(0, sv.getBottom());
duggu
- 37,191
- 12
- 114
- 111
-
-
yes, finally I controlled the time by using a runnable by internals. that the right way, right? – Mahdi Jul 08 '15 at 09:33
0
The below code should work
scrollView.post {
scrollView.fullScroll(View.FOCUS_DOWN)
}
Achintha Isuru
- 1,876
- 15
- 19
0
scrollView.post(new Runnable() {
@Override
public void run() {
scrollView.fullScroll(View.FOCUS_DOWN);
}
});
This worked for me