Android Layouts

Spread the love

A generic ViewGroup that defines a structure for the views it contains.

1.Linear Layout
2.Relative Layout
3.Table Layout
4.List View
5.Grid View
6.Web View

     Linear Layout

  • Child Views are arranged in a horizontal or vertical row.
5

<LinearLayout
   
android:layout_width=”match_parent
   
android:layout_height=”wrap_content
   
android:background=”@color/bg
   
android:clipToPadding=”false”
   
android:gravity=”center”
   
android:orientation=”horizontal>

</LinearLayout>

 

 

  Relative Layout

  • Child Views are positioned relative to each other and parent view.

<RelativeLayout
   android:layout_width=”match_parent”
   android:layout_height=”405dp”> 

</ RelativeLayout >

6

Table Layout

  • Child Views are arranged in to rows and columns.

List View

  • Displays a scrolling single column list.
7

Grid View

  • Child views are arranged in to a two dimensional, scrollable grid.
8

Web View

  • Displays web pages.
9