/** If no children are flexible, how should this component justify its children in the available space? */typedefNS_ENUM(NSUInteger,CKStackLayoutJustifyContent){/** On overflow, children overflow out of this component's bounds on the right/bottom side. On underflow, children are left/top-aligned within this component's bounds. */// 左对齐CKStackLayoutJustifyContentStart,/** On overflow, children are centered and overflow on both sides. On underflow, children are centered within this component's bounds in the stacking direction. */// 居中CKStackLayoutJustifyContentCenter,/** On overflow, children overflow out of this component's bounds on the left/top side. On underflow, children are right/bottom-aligned within this component's bounds. */// 右对齐CKStackLayoutJustifyContentEnd,};
align-items:决定items在交叉轴上的对齐方式。
1234567891011121314
typedefNS_ENUM(NSUInteger,CKStackLayoutAlignItems){/** Align children to start of cross axis */// 交叉轴起点对齐CKStackLayoutAlignItemsStart,/** Align children with end of cross axis */CKStackLayoutAlignItemsEnd,// 交叉轴终点对齐/** Center children on cross axis */// 交叉轴居中对齐CKStackLayoutAlignItemsCenter,/** Expand children to fill cross axis */// 交叉轴方向拉伸CKStackLayoutAlignItemsStretch,};
/** Each child may override their parent stack's cross axis alignment. @see CKStackLayoutAlignItems */typedefNS_ENUM(NSUInteger,CKStackLayoutAlignSelf){/** Inherit alignment value from containing stack. */CKStackLayoutAlignSelfAuto,CKStackLayoutAlignSelfStart,CKStackLayoutAlignSelfEnd,CKStackLayoutAlignSelfCenter,CKStackLayoutAlignSelfStretch,};
CKStackLayoutComponent
A simple layout component that stacks a list of children vertically or horizontally.
动态创建children:
For when the content should respect a certain inherent ratio but can be scaled (think photos or videos).
The ratio passed is the ratio of height / width you expect.