LayoutSpec | Description |
---|---|
ASInsetLayoutSpec |
Applies an inset margin around a component. The object that is being inset must have an intrinsic size. |
ASOverlayLayoutSpec |
Lays out a component, stretching another component on top of it as an overlay. The underlay object must have an intrinsic size. Additionally, the order in which subnodes are added matters for this layoutSpec; the overlay object must be added as a subnode to the parent node after the underlay object. |
ASBackgroundLayoutSpec |
Lays out a component, stretching another component behind it as a backdrop. The foreground object must have an intrinsic size. The order in which subnodes are added matters for this layoutSpec; the background object must be added as a subnode to the parent node before the foreground object. |
ASCenterLayoutSpec |
Centers a component in the available space. The |
ASRatioLayoutSpec |
Lays out a component at a fixed aspect ratio (which can be scaled). This spec is great for objects that do not have an intrinisic size, such as ASNetworkImageNodes and |
ASRelativeLayoutSpec |
Lays out a component and positions it within the layout bounds according to vertical and horizontal positional specifiers. Similar to the “9-part” image areas, a child can be positioned at any of the 4 corners, or the middle of any of the 4 edges, as well as the center. |
ASLayoutSpec |
Can be used as a spacer in a stack spec with other children, when This class can also be subclassed to create custom layout specs - advanced Texture only! |
LayoutSpec | Description |
---|---|
ASStackLayoutSpec |
Allows you to stack components vertically or horizontally and specify how they should be flexed and aligned to fit in the available space. This is the most common |
ASStaticLayoutSpec |
Allows positioning children at fixed offsets using the .sizeRange and .layoutPosition ASLayoutable properties. |
Property | Description |
---|---|
CGFloat .spacingBefore |
Additional space to place before this object in the stacking direction. |
CGFloat .spacingAfter |
Additional space to place after this object in the stacking direction. |
BOOL .flexGrow |
If the sum of childrens' stack dimensions is less than the minimum size, should this object grow? Used when attached to a stack layout. |
BOOL .flexShrink |
If the sum of childrens' stack dimensions is greater than the maximum size, should this object shrink? Used when attached to a stack layout. |
ASRelativeDimension .flexBasis |
Specifies the initial size for this object, in the stack dimension (horizontal or vertical), before the flexGrow or flexShrink properties are applied and the remaining space is distributed. |
ASStackLayoutAlignSelf alignSelf |
Orientation of the object along cross axis, overriding alignItems . Used when attached to a stack layout. |
CGFloat .ascender |
Used for baseline alignment. The distance from the top of the object to its baseline. |
CGFloat .descender |
Used for baseline alignment. The distance from the baseline of the object to its bottom. |
Property | Description |
---|---|
.sizeRange |
If specified, the child's size is restricted according to this ASRelativeSizeRange . Percentages are resolved relative to the static layout spec. |
.layoutPosition |
The CGPoint position of this object within its parent spec. |