There is a button, when you click on a button, a new editText is created, when the screen becomes full of views, you need to automatically scroll down to the last view. This code does not help:

scrollViewPersonal.scrollBy(0,1000000000); 

How to solve a problem?

    2 answers 2

    Scroll the ScrollView down like this:

     scrollViewPersonal.fullScroll(View.FOCUS_DOWN); 

    Add this code to the button click handling method after creating a new View.

    https://stackoverflow.com/questions/3080402/android-scrollview-force-to-bottom

    • does not work) It goes down, but to see the last view you need to skip it yourself - Martinez Toni
    • Ie falls to the penultimate - Martinez Toni

    Solved the problem with scrolling ScrollView when adding a new item:

      scrollViewPersonal.post(new Runnable() { @Override public void run() { scrollViewPersonal.fullScroll(View.FOCUS_DOWN); } }); 

    In some cases, the above code may not work, unfortunately I don’t know the reason. To make it work, you need to use the postDelayed () method .

     scrollView.postDelayed(new Runnable() { @Override public void run() { scrollView.fullScroll(ScrollView.FOCUS_DOWN); } },1000);