Titanium.UI.Window.layout
Platform | Since |
---|---|
Android | 0.9 |
iPhone | 0.9 |
iPad | 0.9 |
Mobile Web | 1.8 |
Summary
Specifies how the view positions its children. One of: 'absolute', 'vertical', or 'horizontal'.
Type
Default
absolute layout
Description
There are three layout options:
-
absolute
. Default layout. A child view'stop
,bottom
,left
, andright
properties are interpreted as absolute values in the parent's coordinate space.If the child includes a
top
value and not abottom
value, the child is positionedtop
units from the top of the parent's bounding box, and its height is set based on itsheight
property.If the child includes a
bottom
value and not atop
value, the child is positionedbottom
units from the bottom of the parent's bounding box. Its height is set based on itsheight
property.If the child includes both
top
andbottom
values, the behavior is platform-specific.Similar calculations are used for
left
andright
.You can also position a child by setting its
center
property to aPoint
.If no position is set explicitly, children are centered. For example, if a child specifies a
top
of 20 and does not specify any other position properties, the child is positioned 20 units from the parent's top, and centered horizontally. -
vertical
. Children are laid out vertically from top to bottom. The first child is laid outtop
units from its parent's bounding box. Each subsequent child is laid out below the previous child. The space between children is equal to the upper child'sbottom
value plus the lower child'stop
value.Each child is positioned horizontally as for the absolute layout mode.
-
horizontal
. Like vertical layout, except children are laid out horizontally from left to right, using theleft
andright
values to determine spacing.Each child is positioned vertically as in the absolute layout mode.