Titanium中布局类Titanium.UI.Window.layout

Titanium.UI.Window.layout

Property of Titanium.UI.Window. Inherited from Titanium.UI.View.
Platform Since
Android 0.9
iPhone 0.9
iPad 0.9
Mobile Web 1.8
Permission: read-write

Summary

Specifies how the view positions its children. One of: 'absolute', 'vertical', or 'horizontal'.

Type

String

Default

absolute layout

Description

There are three layout options:

  • absolute. Default layout. A child view's top, bottom, left, and right properties are interpreted as absolute values in the parent's coordinate space.

    If the child includes a top value and not a bottom value, the child is positioned top units from the top of the parent's bounding box, and its height is set based on its height property.

    If the child includes a bottom value and not a top value, the child is positioned bottom units from the bottom of the parent's bounding box. Its height is set based on its height property.

    If the child includes both top and bottom values, the behavior is platform-specific.

    Similar calculations are used for left and right.

    You can also position a child by setting its center property to a Point.

    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 out top 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's bottom value plus the lower child's top 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 the left and right values to determine spacing.

    Each child is positioned vertically as in the absolute layout mode.

你可能感兴趣的:(PhoneGap,jquerymobile,tianium,混合开发)