ScrollView is a useful view especially when you’re not sure how big the view will be and you want to be sure the user will see everything.
By default, when you create ScrollView and put content inside you see a scrollbar during scrolling.
Let’s take simple code:
var body: some View {
ScrollView {
ForEach(0…100, id: \.self) { number in
Text(“SmashSwift”)
.padding()
}
}
}
During scroll you see scrollbar:
If you don’t want this bar you can set showsIndicators for ScrollView to false and scrollbar disappears.
Now the code looks like:
var body: some View {
ScrollView(showsIndicators: false) {
ForEach(0…100, id: \.self) { number in
Text(“SmashSwift”)
.padding()
}
}
}
The only difference is in the second line with ScrollView.