From class LayoutParams
android:layout_gravity |
Gravity specifies how a component should be placed in its group of cells. The default is android.view.Gravity#TOP . See android.widget.LinearLayout#setGravity(int) .
Must be one or more (separated by '|') of the following constant values.
Constant |
Value |
Description |
bottom |
50 |
Push object to the bottom of its container, not changing its size. |
center |
11 |
Place the object in the center of its container in both the vertical and horizontal axis, not changing its size. |
center_horizontal |
1 |
Place object in the horizontal center of its container, not changing its size. |
center_vertical |
10 |
Place object in the vertical center of its container, not changing its size. |
clip_horizontal |
8 |
Additional option that can be set to have the left and/or right edges of the child clipped to its container's bounds. The clip will be based on the horizontal gravity: a left gravity will clip the right edge, a right gravity will clip the left edge, and neither will clip both edges. |
clip_vertical |
80 |
Additional option that can be set to have the top and/or bottom edges of the child clipped to its container's bounds. The clip will be based on the vertical gravity: a top gravity will clip the bottom edge, a bottom gravity will clip the top edge, and neither will clip both edges. |
end |
800005 |
Push object to the end of its container, not changing its size. |
fill |
77 |
Grow the horizontal and vertical size of the object if needed so it completely fills its container. |
fill_horizontal |
7 |
Grow the horizontal size of the object if needed so it completely fills its container. |
fill_vertical |
70 |
Grow the vertical size of the object if needed so it completely fills its container. |
left |
3 |
Push object to the left of its container, not changing its size. |
right |
5 |
Push object to the right of its container, not changing its size. |
start |
800003 |
Push object to the beginning of its container, not changing its size. |
top |
30 |
Push object to the top of its container, not changing its size. |
|
android:layout_weight |
Indicates how much of the extra space in the LinearLayout is allocated to the view associated with these LayoutParams. Specify 0 if the view should not be stretched. Otherwise the extra pixels will be pro-rated among all views whose weight is greater than 0.
May be a floating point value, such as "1.2 ".
|
|
From class LayoutParams
android:layout_height |
Specifies the basic height of the view. This is a required attribute for any view inside of a containing layout manager. Its value may be a dimension (such as "12dip") for a constant height or one of the special constants.
May be a dimension value, which is a floating point number appended with a unit such as "14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).
Must be one of the following constant values.
Constant |
Value |
Description |
fill_parent |
ffffffff |
The view should be as big as its parent (minus padding). This constant is deprecated starting from API Level 8 and is replaced by match_parent . |
match_parent |
ffffffff |
The view should be as big as its parent (minus padding). Introduced in API Level 8. |
wrap_content |
fffffffe |
The view should be only big enough to enclose its content (plus padding). |
|
android:layout_width |
Specifies the basic width of the view. This is a required attribute for any view inside of a containing layout manager. Its value may be a dimension (such as "12dip") for a constant width or one of the special constants.
May be a dimension value, which is a floating point number appended with a unit such as "14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).
Must be one of the following constant values.
Constant |
Value |
Description |
fill_parent |
ffffffff |
The view should be as big as its parent (minus padding). This constant is deprecated starting from API Level 8 and is replaced by match_parent . |
match_parent |
ffffffff |
The view should be as big as its parent (minus padding). Introduced in API Level 8. |
wrap_content |
fffffffe |
The view should be only big enough to enclose its content (plus padding). |
|
|
From class MarginLayoutParams
android:layout_margin |
Specifies extra space on the left, top, right and bottom sides of this view. If both layout_margin and any of layout_marginLeft, layout_marginRight, layout_marginStart, layout_marginEnd, layout_marginTop, and layout_marginBottom are also specified, the layout_margin value will take precedence over the edge-specific values. This space is outside this view's bounds. Margin values should be positive.
May be a dimension value, which is a floating point number appended with a unit such as "14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).
|
android:layout_marginBottom |
Specifies extra space on the bottom side of this view. This space is outside this view's bounds. Margin values should be positive.
May be a dimension value, which is a floating point number appended with a unit such as "14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).
|
android:layout_marginEnd |
Specifies extra space on the end side of this view. This space is outside this view's bounds. Margin values should be positive.
May be a dimension value, which is a floating point number appended with a unit such as "14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).
|
android:layout_marginHorizontal |
Specifies extra space on the left and right sides of this view. Specifying layout_marginHorizontal is equivalent to specifying layout_marginLeft and layout_marginRight. If both layout_marginHorizontal and either/both of layout_marginLeft and layout_marginRight are also specified, the layout_marginHorizontal value will take precedence over the edge-specific values. Also, layout_margin will always take precedence over any of these values, including layout_marginHorizontal. This space is outside this view's bounds. Margin values should be positive.
May be a dimension value, which is a floating point number appended with a unit such as "14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).
|
android:layout_marginLeft |
Specifies extra space on the left side of this view. This space is outside this view's bounds. Margin values should be positive.
May be a dimension value, which is a floating point number appended with a unit such as "14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).
|
android:layout_marginRight |
Specifies extra space on the right side of this view. This space is outside this view's bounds. Margin values should be positive.
May be a dimension value, which is a floating point number appended with a unit such as "14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).
|
android:layout_marginStart |
Specifies extra space on the start side of this view. This space is outside this view's bounds. Margin values should be positive.
May be a dimension value, which is a floating point number appended with a unit such as "14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).
|
android:layout_marginTop |
Specifies extra space on the top side of this view. This space is outside this view's bounds. Margin values should be positive.
May be a dimension value, which is a floating point number appended with a unit such as "14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).
|
android:layout_marginVertical |
Specifies extra space on the top and bottom sides of this view. Specifying layout_marginVertical is equivalent to specifying layout_marginTop and layout_marginBottom with that same value. If both layout_marginVertical and either/both of layout_marginTop and layout_marginBottom are also specified, the layout_marginVertical value will take precedence over the edge-specific values. Also, layout_margin will always take precedence over any of these values, including layout_marginVertical. This space is outside this view's bounds. Margin values should be positive.
May be a dimension value, which is a floating point number appended with a unit such as "14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).
|
|