Initializer

init(alignment:spacing:content:)

Creates an instance with the given spacing and Y axis alignment.

Declaration

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

Parameters

alignment

the guide that will have the same horizontal screen coordinate for all children.

spacing

the distance between adjacent children, or nil if the stack should choose a default distance for each pair of children.

See Also

Creating a Stack

struct HorizontalAlignment

An alignment position along the horizontal axis

Beta
enum HAlignment

Aligns the child view within its bounds given anchor types

Beta

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software