Android Tutorial For Beginer - Relative and Linear Layouts

Two of the more popular and useful layouts, or as their class derivation is known as view groups, are the relative layout and the linear layout. 


The relative layout allows to arrange its children in a relative fashion according to other sibling children. For instance you can define view a to be below view b or view c to be to the right of view a. You can also align views to their siblings for instance declare that view d should align its left side with the left side of view b. In the image to the right we have one large view at the with two views below, one aligned to the left of the top view and one aligned to the right of the top view.


Linear layouts on the other hand organize their children in a linear order one after another. They can be declared to set their children in a vertical column or a horizontal row and will order them based on their children's declaration ordering. In the image to the right we see a horizontal linear layout with one small view followed by a larger view to the right of it, followed by another smaller view to the right of that.
0 Komentar untuk "Android Tutorial For Beginer - Relative and Linear Layouts"
Back To Top