1. Linear layout LinearLayout
Purpose: arrange the components in the container one by one. This not only controls the horizontal arrangement of each component, but also controls the vertical arrangement of each component (through android: orientation attribute control). features: linear layout does not wrap the line. When a component is arranged in the header one by one, the remaining components do not display attributes:
Android: gravity sets the alignment of components in the layout manager. This attribute supports top, bottom, left, right, center_vertical, fill_vertical, center_horizontal, fill_horizontal, center, fill, clip_vertical, clip_horizontal attribute values. You can also specify multiple alignment combinations. android: orientation sets the arrangement of components in the layout manager.
Ii. TableLayout
Purpose: The table layout uses columns to manage the UI components. Features: you do not need to specify the number of rows and columns of baohang. You can add TableRow and other components to control the number of rows and columns of the table, each time you add a TableRow, It is a row of the table and TableRow is a container. Therefore, it can add other components continuously. Each time you add a sub-component, a column is added to the table. If you directly add a component to TableLayout, this component directly occupies one attribute column:
Android: collapseColumns sets the column numbers of columns to be hidden. Separate multiple column numbers with commas (,). android: shrinkColumns sets the column numbers that can be shrunk, separate multiple sequence numbers with commas (,). adnroid: stretchColumns: Specifies the sequence numbers of columns that can be stretched. Separate multiple sequence numbers with commas (,).
Iii. Frame layout FrameLayout
Purpose: Create a blank area (called a frame) for each component to be added. The feature is that all child components occupy one frame, and these frames are automatically aligned based on the gravity attribute:
Android: foreground: sets the foreground image of the container for this frame layout. android: foregroundGravity defines the gravity attribute of the foreground image.
Iv. Relative layout RelativeLayout
Role: the position of the child components in the relative layout container is always determined by the sibling component and parent container. Therefore, this layout method is called relative Layout features: if the position of component A is determined by the position of component B, Android requires that component B be defined first and the attributes of component A be defined:
Android: gravity: sets the alignment of child components in the layout container. android: ignoreGravity: sets the component to ignore the influence of gravity components.
5. Absolute layout Absolutelayout
Function: controls the position of a component using the x coordinate y coordinate. When AbsoluteLayout is used as the layout container, the layout container no longer manages the position and size attributes of the Child component:
Layout_x: Specifies the x coordinate of the Child component layout_y specifies the y coordinate of the Child component