I found this this modifier on any scrolling view... iOS Deployment target should be 16.4.
.scrollBounceBehavior(.basedOnSize, axes: .horizontal)
Another ugly workaround:
@State private var contentLargerThanScrollView = false
GeometryReader { reader in
ScrollView(.horizontal) {
HStack {
ForEach(0..<15) {
Text("\($0)")
.padding(.horizontal)
}
}.background(
GeometryReader { proxy in
Color.clear.onAppear { contentLargerThanScrollView = proxy.size.width > reader.size.width }
}
)
}
.disabled(!contentLargerThanScrollView)
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: