Layout in Android - Types of Android Layouts in App Development

A layout defines the structure for a user interface in your app, such as in an activity. All elements in the layout are built using a hierarchy of View and ViewGroup objects. A View usually draws something the user can see and interact with. 

To define a layout, create an XML file with a root View element. Then, add one or more View or ViewGroup objects to the hierarchy. Each view is described by two things: its position in the hierarchy and its appearance. 

Types of Layouts in Android 

  1. Linear Layout in Android 
  2. Relative Layout in Android 
  3. Table Layout in Android 
  4. Absolute Layout in Android 
  5. Frame Layout in Android 
  6. List View in Android 
  7. Grid Layout in Android

1. Linear Layout in Android

A Linear Layout is a view group that aligns all children in a single direction, vertically or horizontally.

 

2. Relative Layout - Suppose we want to have three buttons in our application that are of the same type, such as 'Text view,' where the first Text view, and where the second text view, above or below, is left or right. We have to specify the particular position, which is done by relative Layout.

 

3. Table Layout - Table Layout is a view that group views into rows and columns.

 

4. Absolute Layout - Absolute Layout enables you to specify the exact location of its children.

 

5. Frame Layout - The Frame Layout is a placeholder on the screen that you can use to display a single view.

 

6. List View - List View is a view group that displays a list of scrollable items.

 

7. Grid Layout - It is a view group that displays a grid of scrollable items.


Source: LearnVern

Comments

Popular posts from this blog

Android SDK Installation - How to Install SDK in Android Studio?

Android Components - Types of Android Components

Java for Android - Basic java for Android App Development