Detailed explanation of measure process of Android view drawing process (I) detailed explanation of measure process of decorview and viewrootimplandroid view drawing process of Android view drawing process (I) detailed explanation of layout and draw process of Android view drawing process (II) Android view event distribution principle analysis Android custom view detailed explanation of Android view drawing process decorview and viewrootimp

In the previous article, decorview and viewrootimpl of Android view drawing process analyzed how decorview is associated with activity after calling setcontentview, and finally talked about the logic of viewrootimpl starting drawing. This paper goes on to the first part and continues to analyze the drawing process of view.

As mentioned above, call performtraversals to draw. Because the performtraversals method is relatively long, see a simplified version:

The process is as follows:

The whole drawing process of view can be divided into the following three stages:

Before introducing drawing, learn about measurespec. Measurespec encapsulates the layout requirements passed from the parent layout to the child layout. It is represented by a 32-bit int value, which contains two kinds of information. The upper two bits represent SpecMode@H_ 419_ 107 @ (measurement mode), the lower 30 bits indicate SpecSize@H_ 419_ 107 @ (specific size of measurement). The following analyzes classes by annotation:

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
分享
二维码
< <上一篇
下一篇>>