One Logo Pool Ball
SwiftUICore · IOS API REFERENCE

HStackLayout

struct · iOS 16.0+ · SDK 27.1

@frozen struct HStackLayout

A horizontal container that you can use in conditional layouts. This layout container behaves like an ``HStack``, 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 ``HStack`` 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?: VerticalAlignment, spacing?: (number) | null): HStackLayout
Swift declaration
init(alignment: VerticalAlignment = .center, spacing: CGFloat? = nil)

Creates a horizontal stack with the specified spacing and vertical alignment. - Parameters: - alignment: The guide for aligning the subviews in this stack. It has the same vertical 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(): VerticalAlignment
Swift declaration
var alignment: VerticalAlignment

The vertical alignment of subviews.

set · iOS 16.0+

alignment

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

The vertical alignment of subviews.

Skipped declarations

No declarations were skipped in this snapshot.

All SwiftUICore types →