SwiftUI - 隐藏 ScrollView 的指示器使其停止滚动

Luk*_*ers 10 macos swift swiftui

我试图隐藏 a 的指示器,ScrollView但是当我尝试这样做时,ScrollView它不再滚动。如果这很重要,我正在使用 macOS。

ScrollView(showsIndicators: false) {
    // Everything is in here
}
Run Code Online (Sandbox Code Playgroud)

Asp*_*eri 1

应@SoOverIt 的要求

演示:

演示

没什么特别的,只是启动了一些其他测试示例。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)
}
Run Code Online (Sandbox Code Playgroud)