Skip to main content

Module alignment

Module alignment 

Source
Expand description

Alignment tokens: unit values that name one position and convert into exactly the alignment types that position is legal for.

vstack(..).alignment(Leading) reads as the intent; vstack(..).alignment(Top) does not compile, because Top has no Into<HorizontalAlignment>. The per-container methods (.leading(), .top(), .top_leading(), …) are the same positions spelled without an argument.

Structs§

Bottom
The bottom edge: an HStack row, or a two-dimensional cell centered horizontally.
BottomLeading
The bottom-leading corner of a two-dimensional cell.
BottomTrailing
The bottom-trailing corner of a two-dimensional cell.
Center
The center on whichever axes the container aligns.
FirstBaseline
The first text baseline of an HStack row.
LastBaseline
The last text baseline of an HStack row.
Leading
The leading edge: a VStack column, or a ZStack/Frame/Grid cell centered vertically.
Top
The top edge: an HStack row, or a two-dimensional cell centered horizontally.
TopLeading
The top-leading corner of a two-dimensional cell.
TopTrailing
The top-trailing corner of a two-dimensional cell.
Trailing
The trailing edge: a VStack column, or a two-dimensional cell centered vertically.