Reputation: 31
I created an application in SwiftUI and use vertical scrolling. I want to turn off bouncing while scrolling the scroll view. How can I achieve this?
Upvotes: 3
Views: 1795
Reputation: 676
I was able to turn off bounce for a SwiftUI list by turning off tableview bounce in the init(). I haven't tested it for scrollview but maybe you can do something similar?
init() {
UITableView.appearance().bounces = false
}
Upvotes: 1
Reputation: 430
You cannot simply restrict scrollView's bounce, but you can achieve this by UIScollView's property.
UIScrollView.appearance().bounces = false
Add this in App-delegate or View's initialiser method. Hope This will help you.
Upvotes: 0