-
Describes how the column’s children will be horizontally aligned.
See moreDeclaration
Swift
public enum ColumnAlignment : Equatable -
Declaration
Swift
public var children: [(element: Element, traits: StackLayout.Traits, key: AnyHashable?)] -
Declaration
Swift
public private(set) var layout: StackLayout { get } -
Declaration
Swift
public init() -
Creates a Column, using result builder syntax. Columns display a list of items in a vertical stack.
Column { Label(text: "Welcome") TextField(text: username) TextField(text: password) Button( onTap: handleSignIn, wrapping: Label(text: "Sign In") ) }By default, each item in the column will be stretched or compressed with equal priority in the event of overflow or underflow. You can control this behavior by adding a
stackLayoutChildmodifier to an item.Column { ImportantHeader() .stackLayoutChild(priority: .fixed) LessImportantContent() }You can also use this modifier to add keys and alignment guides. See
StackElement.addfor more information.See Also
Declaration
Swift
public init( alignment: ColumnAlignment = .leading, underflow: StackLayout.UnderflowDistribution = .spaceEvenly, overflow: StackLayout.OverflowDistribution = .condenseProportionally, minimumSpacing: CGFloat = 0, @ElementBuilder<StackLayout.Child> elements: () -> [StackLayout.Child] )Parameters
alignmentSpecifies how children will be aligned horizontally. Default:
.leadingunderflowDetermines the layout when there is extra free space available. Default:
.spaceEvenlyoverflowDetermines the layout when there is not enough space to fit all children as measured. Default:
.condenseProportionallyminimumSpacingSpacing in between elements. Default:
0elementsA block containing all elements to be included in the stack.
-
Declaration
Swift
public var verticalUnderflow: StackLayout.UnderflowDistribution { get set } -
Declaration
Swift
public var verticalOverflow: StackLayout.OverflowDistribution { get set } -
Specifies how children will be aligned horizontally.
Declaration
Swift
public var horizontalAlignment: ColumnAlignment { get set } -
Declaration
Swift
public var minimumVerticalSpacing: CGFloat { get set }
View on GitHub
Column Structure Reference