SoFunction
Updated on 2025-04-09

Android scrollview Automatically scroll to the top or bottom instance

android scrollview automatically scrolls to the top or bottom

Summary: android scrollview automatically scrolls to the top or bottom

android scrollview automatically scrolls to the top or bottom

//Set default scroll to top (new Runnable() {
  
  @Override
  public void run() {
  // TODO Auto-generated method stub
  (ScrollView.FOCUS_UP);
  }
 });
//Set default scroll to bottom (new Runnable() {
  
  @Override
  public void run() {
  // TODO Auto-generated method stub
  (ScrollView.FOCUS_DOWN);
  }
 });

Another method is to set the first control in the scrollview

android:focusable="true"

android:focusableInTouchMode="true"

Thank you for reading, I hope it can help you. Thank you for your support for this site!