Android layout manager (linear layout) and android Layout
Linear layout is represented by the LinearLayout class. The linear layout of Android is a bit similar to the Box of Swing (they all sort the components in the container one by one). In LinearLayout, android is used: orientation attributes control whether the layout is horizontal or vertical (vertical horizontal, horizontal vertical)
XMLAttribute |
Related Methods |
Description |
Android: baselineAligned |
SetBaselineAligned (boolean) |
If this attribute is set to false, the layout manager and its child elements are blocked from baseline |
Android: divider |
SetDividerDrawable (Drawable) |
Vertical layout of split bars between two split buttons |
Android: gravity |
SetGravity (int) |
Sets the alignment of components in the layout manager. The attributes include top, left, right, center_vertical, and fill_vertical. |
Android: measureWithLargestChild |
SetMeasureWithLargestChildEnabled (boolean) |
When this attribute is set to true, all child elements with weight will have the minimum size of the Maximum child element. |
Android: orientation |
SetOrientation (int) |
Set the alignment of components in the layout manager, horizontal: horizontal, vertical: vertical |
Common XML attributes of LinearLayout child elements
XMLAttribute |
Related Methods |
Description |
Android: layout_gravity |
|
Specifies the alignment of the child element in LinearLayout. |
Android: layout_weight |
|
Specify the weight of the child element in LinearLayout. |
Specific attribute effects: