Android control layout property keys

1. Android page layout is divided into 6 types:

LinearLayout (linear layout), RelativeLayout (relative layout), TableLayout (table layout), FrameLayout (frame layout), GridLayout (grid layout), AbsoluteLayout (absolute layout)
2. Linear layout LinearLayout
orientation: direction; vertical, vertical; horizontal , Horizontal
gravity: alignment, the alignment of the child control relative to the current control
layout_gravity: the alignment of the current control relative to the parent control
margin: the spacing of the current control relative to the surrounding.
padding: The spacing of the child controls in the current control relative to the surroundings of the current control.

3. Relative layout RelativeLayout starts from the upper left corner. To control the position, you need to set the position of each control relative to other controls.
layout_below: below which control is located
layout_above: above which control
layout_toLeftOf: specifies the current control is located on the left of which control
layout_toRightOf: specifies the current control is located on the right of which control
layout_alignParentRight: the current control is based on the parent form's alignment
layout_centerHorizontal: horizontally centered
layout_centerVertical: vertically centered
layout_centerInParent: located in the middle of the parent form

4. Frame layout FrameLayout
frame layout of the sub-controls are superimposed layer by layer.
5. Table Layout TableLayouts
A TableRow in TableLayout represents a row, and a control in TableRow represents a column

Guess you like

Origin blog.csdn.net/weixin_44941105/article/details/103997264