Chap3mad Relative Layout
Chap3mad Relative Layout
UI COMPONENTS AND
LAYOUTS
Relative Layout
RelativeLayout is a view group that
displays child views in relative positions.
Android RelativeLayout enables you to
specify how child views are positioned
relative to each other.
The position of each view can be
specified as relative to sibling elements
or relative to the parent.
RelativeLayout Attributes
Following are the important attributes specific to
RelativeLayout −
1. android:id
This is the ID which uniquely identifies the layout.
2. android:gravity
This specifies how an object should position its
gravity.
Using RelativeLayout, you can align two elements by
right border, or make one below another, centered in
the screen, centered left, and so on.
By default, all child views are drawn at the top-left of