Layouts in Android Studio

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 10

LAYOUTS IN ANDROID STUDIO

LAYOUTS
• Android layouts 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 combination of view and view group.
• An android 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 view and view group.
VIEW & VIEWGROUP
• All the elements in the layout are build using hierarchy of view and view group objects.
a. VIEW
A view is defined as the user interface which is used to create interactive UI
components such as TextView, ImageView, EditText, RadioButton etc. and is responsible
for event handling and drawing. They are generally called widgets.
b. VIEWGROUP
A viewgroup is act as a bas class for layouts and layouts Parameters that hold other
view and viewgroup and to define the
CONT..
layout properties. They are generally called layouts.
VIEWGROUP

VIEW VIEW VIEWGROUP

VIEW VIEW
VIEW
CONT..
• The android framework allow us to use the UI elements or Widgets in two
ways:
a. Use UI elements in the XML file
b. Create elements in the kotlin file dynamically
TYPES OF LAYOUTS
1. Android Linear Layout
2. Android Relative Layout
3. Android Constraint Layout
4. Android Frame Layout
5. Android Table Layout
6. Android Web View
7. Android List View
8. Android Grid View
CONT..
1. Android Linear Layout
Linear Layout 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.
2. Android Relative Layout
Relative Layout is View group 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 parents).
CONT..
3. Android Constraint Layout
Constraint Layout is View group subclass, used to specify the position of
layout constraint for every child View relative to other view present. A
constraint Layout is similar to Relative Layout but having more power.
4. Android Frame Layout
Frame Layout is a view group subclass, used to specify the position of view
elements it contains on the top of each other display only a single view inside
the Frame Layout.
CONT..
5. Android Table Layout
Table Layout is a view group subclass, used to display the child view elements in
rows and columns.
6. Android Web View
Web View is a browser that is used to display web pages in our activity layout.
7. Android List View
List View is a view group used to display scrollable list of items in a single
column.
CONT..
8. Android Grid View
Grid View is a view group that is used to display a scrollable list of items
in a grid view of rows and columns.

You might also like