RelativeLayout
Overview
RelativeLayout positions controls using relative positioning — placing them relative to other controls or the parent container. When designing relative layouts, follow dependency relationships between controls; controls added later depend on those added earlier.
Example
<RelativeLayout
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="match_parent">
</RelativeLayout>
Properties
Common Properties
Private Properties
| Property | Description | Values |
|---|---|---|
| layout_weight | Child weight | Number When the parent is LinearLayout, child controls can set weight |
| gravity | Internal control alignment | Usage reference top bottom left right center_vertical fill_vertical center_horizontal fill_horizontal center fill clip_vertical clip_horizontal |