Android Layout Types
There are number of Layouts provided by Android which you will use in almost all the Android applications to provide different view, look and feel.| Sr.No | Layout & Description |
|---|---|
| 1 | Linear Layout LinearLayout is a view group that aligns all children in a single direction, vertically or horizontally. |
| 2 | Relative Layout RelativeLayout is a view group that displays child views in relative positions. |
| 3 | Table Layout TableLayout is a view that groups views into rows and columns. |
| 4 | Absolute Layout AbsoluteLayout enables you to specify the exact location of its children. |
| 5 | Frame Layout The FrameLayout is a placeholder on screen that you can use to display a single view. |
| 6 | List View ListView is a view group that displays a list of scrollable items. |
| 7 | Grid View GridView is a ViewGroup that displays items in a two-dimensional, scrollable grid. |
Layout Attributes
Each layout has a set of attributes which define the visual properties of that layout. There are few common attributes among all the layouts and their are other attributes which are specific to that layout. Following are common attributes and will be applied to all the layouts:| Attribute | Description |
|---|---|
| android:id | This is the ID which uniquely identifies the view. |
| android:layout_width | This is the width of the layout. |
| android:layout_height | This is the height of the layout |
| android:layout_marginTop | This is the extra space on the top side of the layout. |
| android:layout_marginBottom | This is the extra space on the bottom side of the layout. |
| android:layout_marginLeft | This is the extra space on the left side of the layout. |
| android:layout_marginRight | This is the extra space on the right side of the layout. |
| android:layout_gravity | This specifies how child Views are positioned. |
| android:layout_weight | This specifies how much of the extra space in the layout should be allocated to the View. |
| android:layout_x | This specifies the x-coordinate of the layout. |
| android:layout_y | This specifies the y-coordinate of the layout. |
| android:layout_width | This is the width of the layout. |
| android:layout_width | This is the width of the layout. |
| android:paddingLeft | This is the left padding filled for the layout. |
| android:paddingRight | This is the right padding filled for the layout. |
| android:paddingTop | This is the top padding filled for the layout. |
| android:paddingBottom | This is the bottom padding filled for the layout. |
No comments:
Post a Comment