Ana içeriğe geç
Version: 1.6.0

Stack Customization

alignment

By using alignment, you can place the child of the stack you are on at 9 points of the grid.

VStack({alignment: "hereAlignment" })()

cTop

Center and top alignment

VStack({alignment: cTop})(
Text("Hello World")
)

Tuval UI Playground

cTopLeading

Left and top alignment

VStack({alignment: cTopLeading})(
Text("Hello World")
)

Tuval UI Playground

cTopTrailing

Right and top alignment

HStack({alignment: cTopTrailing})(
Text("Hello World")
)

Tuval UI Playground

cLeading

Center and left

HStack({alignment: cLeading})(
Text("Hello World")
)

Tuval UI Playground

cTrailing

Center and right

HStack({alignment: cTrailing})(
Text("Hello World")
)

Tuval UI Playground

Spacing

Throws a space between each view except the space below the subview

HStack({ spacing: 50 })(
VStack({ spacing: 50 })(
HStack().width(100).height(100).background("red"),
HStack().width(100).height(100).background("red"),
HStack().width(100).height(100).background("red"),
),
VStack({ spacing: 50 })(
HStack().width(100).height(100).background("red"),
HStack().width(100).height(100).background("red"),
HStack().width(100).height(100).background("red"),
),
VStack({ spacing: 50 })(
HStack().width(100).height(100).background("red"),
HStack().width(100).height(100).background("red"),
HStack().width(100).height(100).background("red"),
),
)

Tuval UI Playground