There was a property in the initializer with ScrollView(alwaysBounceVertical: false) but I cant't seem to find it anymore.
Does anyone know how I can disable the vertical bounce / overscroll on a SwiftUI ScrollView?
There was a property in the initializer with ScrollView(alwaysBounceVertical: false) but I cant't seem to find it anymore.
Does anyone know how I can disable the vertical bounce / overscroll on a SwiftUI ScrollView?
Yes, it has been removed from the initializer of ScrollView, now you have to update the appearance of the UIScrollView in order to restrict the scrolling.
UIScrollView.appearance().bounces = false
This line will restrict the scrolling, you can apply this in the AppDelegate(didFinishLaunching) or the init() method of your View.
Yes, it changed in Beta 4:
ScrollView(.vertical, showsIndicators: false) { ... }
The new initializer is:
public init(_ axes: Axis.Set = .vertical, showIndicators: Bool = true, content: () -> Content)
The only way I managed to make the bounce
disappear...
func setup()->Bool{
UIScrollView.appearance().bounces = false
return false
}
@main
struct myApp: App {
private var useless:Bool = setup()
var body: some Scene { [...]