Detailed example of Android controlling Scrollview scrolling

Detailed example of Android controlling Scrollview scrolling

During development, we often need to update the list and pull the list to the bottom, such as posting microblog, chat interface, etc,

There are two methods. First, use scrollto ():

The implementation of the first method is relatively troublesome. It is more recommended to use the second method, fullscrol ()

Let's take a look at this function:

It should be noted that this method cannot be called directly because many Android functions are synchronized based on the message queue, so an operation is required. After addview is completed, it will not be displayed immediately, but wait in the queue for processing. Although it is very fast, if fullscroll is called immediately, the view may not be displayed, so it will fail, It should be updated in the new thread through the handler

If you have any questions, please leave a message or go to the community of this site for communication and discussion. Thank you for reading. I hope this article can 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
分享
二维码
< <上一篇
下一篇>>