Bialy Bialy - 1 year ago 61
Android Question

Scrolling a ScrollView to a specific id

I have a Scrollview in my activity , I want when I press a button the view scrolls down to a specific ID in the view. After some search here I found I can use this code Runnable() {
public void run() {

but it scrolls all the page down. I want to scroll to a specific ID in the middle of the view

Answer Source
ScrollView scrollView = (ScrollView) findViewById(;
scrollView.postDelayed(new Runnable() {
     public void run() {
          scrollView.scrollTo(0, (int)view.getY());
}, 100);

view = your view you want to scroll to

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download