View groups can displayed more than one view. (Can contain more than one view). Its like container.
They do extend the view class and add methods that makes easier to work with multiple view contain within it.
Will nearly always be used via a subclass.
Some Viewgroups are named __Layout
Ex:- LinearLayout, RelativeLayout, FrameLayout,ListView etc.
1.LinearLayout :- lay out the views in order one after another with the orientation mentioned (Its mentioned as one of its attribute in layout xml file. android:orientation="Vertical” means all the view will be displayed in vertical order).
2.RelativeLayout:- There is no orientation in this layout . Need to provide the relative position in the view. If position not mentioned then all the view appear on one another. We can use the view’s position by specifying in the view’s attribute ex. android:layout_below=“@id/textview”.Here @id/textview is the id of the view below which this view will be get displayed. there are multiple option like above, right, left etc.
No comments:
Post a Comment