First declare that the property is valid only in LinearLayout. The reason why Android:layout_weight will cause controversy,
is to set Android:layout_width to Wrap_content and match_parent while setting this property
will result in two diametrically opposed effects.
The true meaning of android:layout_weight is that once the view has set the attribute (assuming it is valid),
Then the width of the view is equal to the original width (android:layout_width) plus the proportion of the remaining space!
Set the screen width to L, the width of the two view is Match_parent, the original width is L, two of the view width is L,
Then the remaining width is L (l+l) =-L, the left view accounted for One-third, so the total width is L + (-l) *1/3 = (2/3) L. In fact, the default view weight This value is 0,
Once this value is set, the reason for the view to execute onmeasure two times at the time of drawing is here.
Google's official recommendation, when using the weight attribute, set the width to 0dip, the effect is the same as set to Wrap_content. So weight can be understood as a proportion!