RelativeLayout Android studio – Android Layout Part 1

What is the layout for android? the different types of layouts in android-Linear, Relative, Absolute, Frame, Table Layout. How arrange the linear layout? What is Relative Layout and their attribute?

– What is layout in android?
Layout is nothing but the visual structure for the user interface structure. It is also known as ViewGroup. There are some view such as Table, TextBox, Label etc. need to contained inside the layout. It is used to design the android screens.

– types of layouts in android
There are many types of layouts in android.
1.Linear Layout:
It is used to show the alignment of children in vertically and horizontally.
2.Relative Layout:
It is a view group that displays child views in relative positions.
3.Absolute Layout:
It is used to specify the exact location of children of its children.
4.Frame Layout:
It is used to show multiple children in single frame layout.
5.Table Layout
It is used to show the view groups in tabular format means Rows and Columns.
– What is Relative Layout?
By using relative layout, you can specify the position of the each view in relation to other view, or in relation to the parent container. You can arrange the view on right, left, top, bottom or center.
Attributes of Relative Layout:
android id= It is unique identity of layouts.
android:gravity= It specify the position of object on X and Y axes.
android:ignoreGravity= It is used to indicate what view should not be affected by gravity.


Leave a Reply

Your email address will not be published. Required fields are marked *