Initializer

init(alignment:spacing:content:)

Creates an instance with the given spacing and horizontal alignment.

Declaration

init(alignment: HorizontalAlignment = .center, spacing: CGFloat? = nil, @ViewBuilder content: () -> Content)

Parameters

alignment

The guide for aligning the subviews in this stack. It has the same horizontal screen coordinate for all children.

spacing

The distance between adjacent subviews, or nil if you want the stack to choose a default distance for each pair of subviews.

content

A view builder that creates the content of this stack.

See Also

Creating a Stack

struct HorizontalAlignment

An alignment position along the horizontal axis.