Android Layouts

Android Layouts and Types of Android Layouts

Vamsi Tallapudi Android 4 Comments

Android Layouts:

A Layout dictates the alignment of widgets (such as Text, Buttons, EditText box) as we see in the Android Application. All the visual structure we see in an android app is designed in a Layout. Every Layout is defined in an xml file which is located in App > res > Layout in New Android Studio.
Android Layouts

In this article we are going to discuss briefly on Types of Layouts as they are going to be needed in every Android Application Project we create.

Types of Layouts:

The layouts most commonly used are:

  1. Linear Layout
  2. Relative Layout

However there are several other layouts such as:

  1. Web View Layout
  2. Frame Layout
  3. List View Layout
  4. Grid View Layout

Here we try to discuss these layouts in brief as these layouts are used extensively in any Android Project.

Linear Layout:

Linear Layout is a layout which aligns the widgets or elements in a linear (Straight) fashion. Linear Layout consists of two types of orientation:

  1. Vertical Orientation,
  2. Horizontal Orientation.

Vertical Orientation is shown above where the widgets such as Text View, Edit Text, and Button are aligned in a Vertical manner.

Android Linear Layout

Similarly there exists a Horizontal Orientation where the widgets are arranged in a horizontal manner. Horizontal orientation or Vertical orientation will be discussed further in our next articles.

Relative Layout:

Relative Layout is a layout where the widgets (such as Text Views, Buttons, etc.) are represented with respect to previous widget or parent View. A Relative Layout example is shown in the figure below.Android Relative Layout

Here in the above figure, ‘Forgot Password’ button is positioned relative to ‘Login’ Button, whereas ‘Register a new Account’ is aligned with respect to Parent Layout.

List View:

A List View is a View Layout where all the items are specified in the form of a list as shown in fig. below.

Android List View

It is one of the very useful form of layouts. List view, as shown in figure below consists of an order of List items as shown below.

List View will further be discussed in the future article along with an example.

Grid View:

A Grid View is a View Layout where the items (such as pictures, files etc.) are placed in a Grid manner as shown in figure below.

Android Grid View

These are the brief discussions on typical Android Layouts which are mostly used in Android Development. These are again explored in depth along with examples in our future tutorials.



Related Posts