Android Layout
Android Layout
to
Android
WHAT IS ANDROID
LAYOUT?Android Layout is used to
define the user interface that
holds the UI controls or widgets
that will appear on the screen
of an android application or
activity screen. Generally,
every application is a
combination of View and
ViewGroup.
WHAT IS ANDROID
As we know, an android
LAYOUT?
application contains a large number of activities
and we can say each activity is one page of the
application. So, each activity contains multiple
user interface components and those components
are the instances of the View and ViewGroup. All
the elements in a layout are built using a
hierarchy of View and ViewGroup objects.
TYPES OF ANDROID
LAYOUT
• Android Linear Layout: LinearLayout is a ViewGroup subclass,
used to provide child View elements one by one either in a
particular direction either horizontally or vertically based on the
orientation property.
• Android Relative Layout: RelativeLayout is a ViewGroup
subclass, used to specify the position of child View elements
relative to each other like (A to the right of B) or relative to the
parent (fix to the top of the parent).
• Android Constraint Layout: ConstraintLayout is a ViewGroup
subclass, used to specify the position of layout constraints for
TYPES OF ANDROID
LAYOUT
• Android Frame Layout: FrameLayout is a ViewGroup
subclass, used to specify the position of View elements it
contains on the top of each other to display only a single View
inside the FrameLayout.
• Android Table Layout: TableLayout is a ViewGroup subclass,
used to display the child View elements in rows and columns.
• Android Web View: WebView is a browser that is used to
display the web pages in our activity layout.
• Android ListView: ListView is a ViewGroup, used to display
scrollable lists of items in a single column.
• Android Grid View: GridView is a ViewGroup that is used to
Linear
Layout
Linear Layout is the most basic layout
in android studio, that aligns all the children
sequentially either in a horizontal manner or
a vertical manner by specifying the
android:orientation attribute. If one applies
android:orientation=”vertical” then elements
will be arranged one after another in a
vertical manner and If you apply
android:orientation=”horizontal” then
elements will be arranged one after another
in a horizontal manner.
Attributes Description
It is defined individually to the child’s views to specify how
android:layout_weight LinearLayout divides the remaining space amongst the views it
contains