Android developers can easily create layouts with the help of simple HTML file. Different Android layouts are used in Android mobile application which are linear layout, relative layout, table layout, grid view, tab layout and list view. Brief information on these layout forms is shared as below:
- Linear layout shows every element in linear fashion either horizontal or vertical. You can set this behavior in android:orientation i.e. actually and attribute of node LinearLayout. For its creation, you just need to create a new project by following File -> New -> Android Project. After it, click on res/layout folder for creating a new XML file.
- Relative layout is another fashion in which every element is arranged in relevancy of other elements or parent element. For creating this layout, follow “File -> New -> Android Project”.
- As HTML table layout works, in the same way, Table layouts in Android works. You are allowed to divide your layouts into rows and columns. Really, it’s very easier to understand layout where you can manage your task very easily.
- Grid View layout displays items in two-dimensional, scrollable grid. In this layout, grid items are automatically inserted to the layout via ListAdapter. You can dynamically insert views using an adapter.
- In Tab layout, there are three tabs. For getting three tab screens, you will have to create three separate activities. Follow the command File -> New -> Android Project and name your activity like AndroidTabLayoutActivity. After it extend the class from TabActivity. Every tab needs display icon, so don’t forget to design icons. Your icons will be designed in 48 x 48 px, 32 x 32 px and 24 x 24 px and will be placed in drawable-hdpi, drawable-mdpi and drawable-ldpi respectively. You can define the state of the icon with default or hover state configurations.