Pages Navigation Menu

Android Layouts: Linear Layout, Relative Layout and Table Layout

Posted by on Dec 18, 2012 in Android Dev, Development | 2 comments

In this post I will be discussing about the different view layouts in an android mobile application. The six different layouts are : 1. Linear Layout 2. Relative Layout 3. Table Layout 4. Grid View 5. Tab Layout 6. List View Android allows you to create view layouts using simple XML file (we can also create a layout using java code). All the layouts must be placed in /res/layout folder. Okay, now lets get started with the view layouts. 1. Linear Layout In a linear layout, like the name suggests, all the elements are displayed in a linear fashion(below is an example of the linear layouts), either Horizontally or Vertically and this behavior is set in android:orientation which is an attribute of the node LinearLayout. Example of Vertical layout snippet : <LinearLayout android:orientation="vertical"> .... </LinearLayout> Example of Horizontal layout snippet : <LinearLayout android:orientation="horizontal"> .... </LinearLayout> Now that we know the two types...

Read More