Sunday, December 21, 2014
Saturday, December 13, 2014
ViewGroups
ViewGroup
One or more views can be grouped together into a ViewGroup
A ViewGroup (which is itself a special type of view) provides the layout in which you can order the appearance and sequence of views
A ViewGroup derives from the base class android.view.ViewGroup
LinearLayout
AbsoluteLayout
TableLayout
RelativeLayout
FrameLayout
ScrollView
LinearLayout
The LinearLayout arranges views in a single column or a single row.
Default orientation is horizontal
using layout_gravity and layout_weight:
layout_gravity: specifies how child Views are positioned
layout_weight: specifies how much of the extra space in the layout should be allocated to the View
Absolute Layout
The AbsoluteLayout enables you to specify the exact location of its children.
However, there is a problem with the AbsoluteLayout when the activity is viewed on a highresolution
screen. For this reason, the AbsoluteLayout has been deprecated since Android 1.5
TableLayout
The TableLayout groups views into rows and columns.
You use the <TableRow> element to designate a row in the table.
Each row can contain one or more views.
Each view you place within a row forms a cell.
The width of each column is determined by the largest width of each cell in that column
RelativeLayout
The RelativeLayout enables you to specify how child views are positioned relative to each other.
FrameLayout
The FrameLayout is a placeholder on screen that you can use to display a single view.
Views that you add to a FrameLayout are always anchored to the top left of the layout.
ScrollView
A ScrollView is a special type of FrameLayout in that it enables users to scroll through a list of
views that occupy more space than the physical display
The ScrollView can contain only one child view or ViewGroup, which normally is a LinearLayout
One or more views can be grouped together into a ViewGroup
A ViewGroup (which is itself a special type of view) provides the layout in which you can order the appearance and sequence of views
A ViewGroup derives from the base class android.view.ViewGroup
LinearLayout
AbsoluteLayout
TableLayout
RelativeLayout
FrameLayout
ScrollView
LinearLayout
The LinearLayout arranges views in a single column or a single row.
Default orientation is horizontal
using layout_gravity and layout_weight:
layout_gravity: specifies how child Views are positioned
layout_weight: specifies how much of the extra space in the layout should be allocated to the View
Absolute Layout
The AbsoluteLayout enables you to specify the exact location of its children.
However, there is a problem with the AbsoluteLayout when the activity is viewed on a highresolution
screen. For this reason, the AbsoluteLayout has been deprecated since Android 1.5
TableLayout
The TableLayout groups views into rows and columns.
You use the <TableRow> element to designate a row in the table.
Each row can contain one or more views.
Each view you place within a row forms a cell.
The width of each column is determined by the largest width of each cell in that column
RelativeLayout
The RelativeLayout enables you to specify how child views are positioned relative to each other.
FrameLayout
The FrameLayout is a placeholder on screen that you can use to display a single view.
Views that you add to a FrameLayout are always anchored to the top left of the layout.
ScrollView
A ScrollView is a special type of FrameLayout in that it enables users to scroll through a list of
views that occupy more space than the physical display
The ScrollView can contain only one child view or ViewGroup, which normally is a LinearLayout
Subscribe to:
Posts (Atom)



