VStack, HStack and ZStack Fundamentals
Stacking views vertically, horizontally and depth-wise with spacing and alignment.
Welcome
`VStack`, `HStack`, and `ZStack` are the three fundamental layout containers in SwiftUI. Understanding them is essential for building any interface.
VStack — Vertical
```swift
VStack(alignment: .leading, spacing: 8) {
Text("Title").font(.title)
Text("Subtitle").foregroundColor(.secondary)
Button("Action") {}
}
```
All lessons in this course
- VStack, HStack and ZStack Fundamentals
- LazyVGrid and LazyHGrid
- Spacer, Padding and Frame Modifiers
- GeometryReader for Adaptive Layouts