Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - button on click scroll to top of view

Tags:

android

I want to place a button at the bottom of my view (under the ExpandableListView) and the when the button is clicked, it should scroll to the top of the view. Is this possible?

like image 400
Peter Avatar asked Dec 26 '22 02:12

Peter


1 Answers

Try putting the following line in the onClick for that bottom button

yourScrollView.fullScroll(ScrollView.FOCUS_UP);
like image 101
mistwalker Avatar answered Jan 07 '23 17:01

mistwalker