gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 09:18:22 28 4
gpt4 key购买 nike

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

ScrollView(showsIndicators: false) {
// Everything is in here
}

最佳答案

应@SoOverIt 的要求

演示:

demo

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

关于SwiftUI - 隐藏 ScrollView 的指示器使其停止滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59117078/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com