First, linear layout linearlayout
- Function: Arranges the components in the container one by one, not only can control each component horizontal arrangement also can control each component longitudinal arrangement (through the Android:orientation property control)
- Features: Linear layout does not change the components of a love the rest of the components are not displayed after you arrange the head
Property:
- Android:gravity sets the alignment of components within the layout manager, which supports Top,bottom,left,right,center_vertical,fill_vertical,center_horizontal,fill _horizontal,center,fill,clip_vertical,clip_horizontal several property values, or you can specify a combination of multiple alignment options
- Android:orientation to set the arrangement of components within the layout manager
Second, table layout tablelayout
- Role: Table layouts are used to manage UI components in a row and column format
- Features: No clear declaration of the number of treasures, 20 by adding TableRow, other components to control the number of rows and columns of the table, each add a TableRow is a table row, TableRow is also a container, so it can continue to add other components, Add a column to each sub-component, and if you add the component directly to Tablelayout, the component will occupy a column directly
Property:
- Android:collapsecolumns sets the column number of the column that needs to be hidden, separated by commas between multiple column ordinals
- Android:shrinkcolumns sets the number of columns that are allowed to be shrunk, separated by commas between multiple ordinals
- Adnroid:stretchcolumns sets the number of columns allowed to be stretched, separated by commas between multiple column ordinals
three, frame layout framelayout
- Function: Creates a blank area (called a frame) for each component to which it is added
- Feature: All sub-components occupy one frame, and these frames are automatically aligned according to the Gravity property
Property:
- Android:foreground to set the foreground image of the frame layout container
- Android:foregroundgravity defining the Gravity property of the drawing foreground image
iv. Relative Layout relativelayout
- Role: Relative layout container The location of the subcomponents is always determined relative to the sibling component, the parent container, so this layout is called relative layout
- Features: If the position of a component is determined by the position of the B component, Android requires that the B component be defined before a component is defined
Property:
- Android:gravity to set the alignment of the sub-components within the layout container
- Android:ignoregravity set the effect of that component without gravity components
Five, absolute layout absolutelayout
- Function: Controls the position of the component by x-coordinate y-coordinate
- Features: When using Absolutelayout as a layout container, the layout container no longer manages the location, size of the child components
Property:
- Layout_x: Specifies the x-coordinate of the subassembly
- LAYOUT_Y Specifies the y-coordinate of the subassembly