Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SwiftUI - Hiding a ScrollView's indicators makes it stop scrolling

I'm trying to hide the indicators of a ScrollView but when I try doing so, the ScrollView just doesn't scroll anymore. I'm using macOS if that matters.

ScrollView(showsIndicators: false) {
    // Everything is in here
}
like image 827
Luke Chambers Avatar asked Nov 30 '19 14:11

Luke Chambers


1 Answers

On request of @SoOverIt

Demo:

demo

Nothing special, just launched some other test example. Xcode 11.2 / macOS 10.15

var body : some View {

    VStack {
        ScrollView([.vertical], showsIndicators: false) {
            Group {
            Text("AAA")
            Text("BBB")
            Text("CCC")
            Text("DDD")
            Text("EEE")
            }
            Group {
            Text("AAA")
            Text("BBB")
            Text("CCC")
            Text("DDD")
            Text("EEE")
            }
            Group {
            Text("AAA")
            Text("BBB")
            Text("CCC")
            Text("DDD")
            Text("EEE")
            }
            Group {
            Text("AAA")
            Text("BBB")
            Text("CCC")
            Text("DDD")
            Text("EEE")
            }
        }
        .frame(height: 100)
        .border(Color.blue)
    }
    .border(Color.red)
}
like image 59
Asperi Avatar answered Oct 12 '22 01:10

Asperi