Android Scrollview locate the correct way to end

Want to make scrollview scroll to the end, what fullscroll online (view.FUCOS_DOWN) and scrollto (0, scroll.getBottom ()) will not work.

FOCUS_DOWN in the pop input method when there is a great chance to head back to roll over the top, so bad.

bottom scrollview itself is visible there, no more than the length of the screen, certainly not, because we want him to scroll to the screen than most low-end length.

The correct solution is to get inside scrollview last control at the bottom and scroll to where to go.

Code is printed below the character string in the textview scrollview, is added to the string textview up display.

Textview need to scroll after each update to the latest position of the content, which is at the bottom, which is textview bottom.

console is actually a textview.

    private void print(CharSequence s) {
        console.append(s);
        scroll.scrollTo(0,console.getBottom());
    }

 

Guess you like

Origin www.cnblogs.com/memoryLost/p/11109016.html