Android-how to understand the width and height of controls and the difference between layout_grivaty and grivaty, androidlayout
Thoughts on width and height caused by Layout_width/height
Method 1:
The result is not as expected.
Running result:
Method 2:
The results are as expected.
For example:
Android control width and height rules:
By default, the widget in Android does not have width or height, but is given by the parent widget.
The general view control is provided to the ViewGroup control (LinearLayout, RelativeLayout, TableLayout, FrameLayout, and AbsoluteLayou.
The width and height of layout controls such as LinearLayout and RelativeLayout are set by the FrameLayout control of the Android system. You can use hierarchyviewer. bat, a tool under android-sdk/tools, to view details, such:
Solution for method 1 Modification, The following code:
The running result is as follows:
Layout_grivaty and grivaty
Note the following when using layout_grivaty:
The result is as follows:
The result is as follows:
Differences:
Zookeeper