どうも、ちょげ(@chogetarou)です。
ScrollViewのスクロールバーを非表示にする方法を紹介します。
方法

ScrollViewのスクロールバーを非表示にするには、引数「showIndicators」を使います。
具体的には、ScrollViewの引数「showIndicators」にfalseを指定します。
ScrollView(.vertical, showIndicators: false) {
//View
}
ScrollViewの引数「showIndicators」にfalseを指定することで、ScrollViewのスクロールバーを非表示にすることが出来ます。
使用例
struct ContentView: View {
var body: some View {
ScrollView(.vertical, showsIndicators: false) {
ForEach(1..<31) { index in
Text("Item \(index)")
.padding()
}
}
}
}
コメント