Note points for common layouts Linear layout:
- Must have a layout direction horizontal or Vertical
- In vertical layout, only left-to-aligns alignment is applied in the horizontal center
- Only top align bottom align vertical center in horizontal layout in effect
- Weight: The component assigns the remainder of the screen proportionally (that is, the length of the component that is now assigned and then the remainder of the screen by weight), so it is recommended to set the component's length or width to 0DP.
Relative layout:
- The default location of the component is the upper-left corner, which can overlap between components
- Aligns vertically and horizontally relative to the parent element, centered in a vertical center relative to the parent element and centered horizontally and vertically
- can be aligned up or down relative to other components
- Can be layout with other components up or down
Frame layout:
- The component default location is the upper-left corner and can overlap between components
- You can set the relative to the character element up or down the horizontal center, set the same method and the linear layout
Table layout:
- Each TableRow child node represents a row, and each child node of that node represents a column
- The width of each tavlerow child node is the content of the package and cannot be changed, so it does not need to be set
- The width and height of each TableRow child node are the contents of the package and cannot be changed, so no setting is required.
Absolute layout:
- Due to the problem of the resolution of the Android phone the absolute layout is unthinkable when fitted to the phone, so the relative layout is almost no
Attention points for common layouts in Android development