XML layout file
The layout file in xml format is stored in the folder res/layout
The layout methods are mainly LinearLayout (linear layout) and TableLayout (table layout) , RelativeLayout (relative layout)
Of course, there are also AbsoluteLayout, (absolute layout), FrameLayout (frame layout), etc.
They can also be nested to achieve better interface effects
I have sorted out the commonly used attributes based on my personal understanding
It may not be scientific but I think it is very practical.
Control is the whole:
android: ID address
android: width width
android: Height height
android: layout_width width (fill_parent/wrap_content)
android:layout_height (fill_parent/wrap_content)
android:layout_margin(Left/Top/Right/Bottom) Margin (*dip)
Android: Layout_weight.
android:background . Contents are displayed together (true /false) Relative layout: android:layout_above or but Whose bottom edge the edge is aligned with (id) Android: Layout_toleftof to the right side to align with the left side (ID) android: layout_torightof to the right side of the right side (ID) android: layout_aligntop. Alignment ( ID) Android: Layout_alignbottom. Align with. Who is the right side? The right alignment (id) android:layout_alignParentTop The top is aligned with the top of the parent control (true/false) android:layout_alignParentBottom The bottom is aligned with the bottom of the parent control (true/false) True/False) android: layout_alignparentLeft left to the left side of the parent control (TRUE/FALSE) android: Layout_alignparentrid to the right of the parent control (TR. UE/FALSE) android: layout_centerinparent relative to the parent control (True/False)Android: Layout_CenterHorizontal relative to the level of the parent control level (True/False)
## android: Layout_centervertical Relative to the parent control (True/False)## ~~~~~~~~~~~~~ ~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~
The following is the registration page I just made
The above is the detailed content of Code case sharing for XML layout files. For more information, please follow other related articles on the PHP Chinese website!