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

MOBILE APPLICATION AND DEVELOPMENT

Mobile Application and Development

Table of content
Layouts:
The Layouts in Android
 Constraint Layout
 Linear Layout
 Relative Layout
 Table Layout
 Grid Layout
 Frame Layout
What is Layout?

 Layout
“Layout basically refers to the arrangement of
elements on a page these elements are likely to be
images, texts or styles.” These are a part of Android
Jetpack(collection of Android libraries). They define the structure
of android user interface in the app, like in an activity.
These layouts can have various Widgets like buttons,
labels, textboxes, and many others.
(A widget is a small control of your android application placed on the home screen)
What is Layout?

 We can define a Layout as follows:


Attributes?
 Layout Attributes :
The attributes for customizing a Layout

 android:id: It uniquely identifies the Android Layout.


 android:hint: It shows the hint of what to fill inside the EditText.
 android:layout_height: It sets the height of the layout.
 android:layout_width: It sets the width of the layout.
 android:layout_marginTop: It sets the margin of the from the top of the layout.
 android:layout_marginBottom: It sets the margin of the from the bottom of the
layout.
 android:layout_marginLeft: It sets the margin of the from the left of the layout.
 android:layout_marginRight: It sets the margin of the from the right of the layout.
 android:layout_x: It specifies the x coordinates of the layout.
 android:layout_y: It specifies the y coordinates of the layout.
1-Constraint Layout ?

 Constraint Layout is the Default layout in Android Studio


 Gives you many ways to place objects
 Sometimes the result is not as expected as you want(Cons)
 (Pros) The biggest advantage of Constraint Layout, the
only single layout can handle your UI.(Where in the Relative
layout you needed multiple nested layouts (Linear Layout + Relative Layout)
1-Linear Layout ?

 We use this layout to place the elements in a linear


manner.
 A Linear manner means one element per line.
 This layout creates various kinds of forms on Android. In
this, arrangement of the elements is in a top to bottom
manner.
 This can have two orientations:
 a. Vertical Orientation
 b. Horizontal Orientation
1-Relative Layout ?

 This layout is for specifying the position of the elements


in relation to the other elements that are present there.
1-Table Layout ?

 Android Table Layout going to be arranged groups of


views into rows and columns.
1-Grid Layout ?

 It is used to display items in two-dimensional scrolling


grid.
1-List Layout ?

 It is used to display a list of vertically scrollable items.


1-Frame Layout ?

 The Frame Layout is a placeholder on screen that you


can use to display a single view.

You might also like