One Logo Pool Ball
SwiftUICore · IOS API REFERENCE

VStackLayout

struct · iOS 16.0+ · SDK 27.1

@frozen struct VStackLayout

A vertical container that you can use in conditional layouts. This layout container behaves like a ``VStack``, but conforms to the ``Layout`` protocol so you can use it in the conditional layouts that you construct with ``AnyLayout``. If you don't need a conditional layout, use ``VStack`` instead.

Members (5)

get · iOS 16.0+

spacing

TypeScript
get spacing(): (number) | null
Swift declaration
var spacing: CGFloat?

The distance between adjacent subviews. Set this value to `nil` to use default distances between subviews.

set · iOS 16.0+

spacing

TypeScript
set spacing(value: (number) | null)
Swift declaration
var spacing: CGFloat?

The distance between adjacent subviews. Set this value to `nil` to use default distances between subviews.

init · iOS 16.0+

init

TypeScript
static init(alignment?: HorizontalAlignment, spacing?: (number) | null): VStackLayout
Swift declaration
init(alignment: HorizontalAlignment = .center, spacing: CGFloat? = nil)

Creates a vertical stack with the specified spacing and horizontal alignment. - Parameters: - alignment: The guide for aligning the subviews in this stack. It has the same horizontal screen coordinate for all subviews. - spacing: The distance between adjacent subviews. Set this value to `nil` to use default distances between subviews.

get · iOS 16.0+

alignment

TypeScript
get alignment(): HorizontalAlignment
Swift declaration
var alignment: HorizontalAlignment

The horizontal alignment of subviews.

set · iOS 16.0+

alignment

TypeScript
set alignment(value: HorizontalAlignment)
Swift declaration
var alignment: HorizontalAlignment

The horizontal alignment of subviews.

Skipped declarations

No declarations were skipped in this snapshot.

All SwiftUICore types →