Component - ScrollView
A ScrollView lets users scroll through content that is larger than the screen. It works like a window showing part of a bigger picture, allowing vertical or horizontal scrolling.
A ScrollView lets users scroll through content that is larger than the screen. It works like a window showing part of a bigger picture, allowing vertical or horizontal scrolling.
ScrollView
└── VStack
├── Text
├── Text
├── Text
└── TextScrollView in an iOS app?ScrollView(.horizontal) {
HStack {
ForEach(1...3, id: \ .self) { i in
Text("Item \(i)")
.frame(width: 100, height: 100)
.background(Color.blue)
.foregroundColor(.white)
.padding(5)
}
}
}ScrollView(.vertical) {
VStack {
Text("Hello")
}
Text("World")
}Pass the test and this pattern moves unknown