Android Scrollview displays the implementation code at the bottom or anywhere

Android Scrollview displays to the bottom or anywhere

In fact, it is not difficult to make Scrollview display the bottom. It has its own method fullscroll():

1. Show top:

2. Show bottom:

However, one thing must be noted. This method cannot be called directly, because in Android, many of its functions are implemented based on message queue, that is to say, the fullscroll () method will be executed before the Scrollview is displayed in a high probability (the probability is generally more than 99%). Then he won't work. Will cause a very common problem, showing the bottom failure. Therefore, I thought of delaying the start of this method through the handler:

3, display any location scrollTo (), which is the same as above, must be completed in addView, showing that after the call is effective.

Thank you for reading, hope to help you, thank you for your support to this site!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>