2.2 Common UI Layouts
The layout itself cannot display any data, it can contain some sub-views, and control the layout of the child view
Common layout
2.2.1 LinearLayout
Linear layout: Used to control its sub-view to expand the display horizontally or vertically
Important attributes:
Orientation (direction)
Layout_weight (weight)
Understanding LinearLayout Weights
Value of layout_weight (weight)
-
=0 (default): Specifies how much space to occupy
-
>0: Splits the free space in the parent view, the larger the value, the greater the proportion of the occupied
Layout_weight Usage Scenarios
2.2.2 Relativelayout
Relative layout: Used to control the layout display of its sub-view in a relatively positioned way
Relative layout is the most flexible, most powerful, and the most difficult to learn layout
Relative layout-related properties are more:
-
Sibling views: aligned in the same direction, aligned in the opposite direction
-
Between the parent view: Align in the same direction, centered
2.2.3 Framelayout Frame layout of each sub-view represents a picture, by default, the upper-left corner of the screen as (0,0) coordinates, by the definition of the order by screen display, followed by the previous screen will be covered, through the child view of the Android:layout_ Gravity property to specify the location of the child view
2.3 Common View Label properties
Partitioning of attributes
Properties for any view
Common most basic properties
Padding properties
Padding Margin Properties
Margin is only for relativelayout properties
Inverse Direction Alignment Property
To/above/below the same Direction alignment property
Align properties relative to parent view
Alignparent/center only for LinearLayout properties
Weight attribute Weight
Direction attribute Oritation
Common basic Properties
Inner margin and margins
Relative sibling view positioning
Relative Parent View Positioning
Android Application Development Foundation _UI