Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SwiftUI ScrollView is not able to disable vertical bounce?

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?

like image 318
test Avatar asked Jul 21 '19 10:07

test


Video Answer


1 Answers

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.

like image 101
Anshuman Singh Avatar answered Sep 19 '22 05:09

Anshuman Singh