I've tried many times, but I just can't manage to disable the scroll bounce effect in a horizontal scroll view in SwiftUI. It works when I use a vertical scroll view. Here's some sample code.
import SwiftUI
struct Temp: View {
var body: some View {
ScrollView(.horizontal, showsIndicators: false) {
HStack(spacing: 8) {
Rectangle()
.frame(width: 40, height: 40)
Rectangle()
.frame(width: 40, height: 40)
}
}
.scrollBounceBehavior(.basedOnSize)
}
}
#Preview {
Temp()
}
Appreciate your help!