How do I disable the bounce effect when vertically scrolling a UITableView? Right now if I scroll anywhere near the bottom, the view scrollbar bo开发者_JAVA百科unces right up. I would like my UITableView to stay fixed at the scrolled-to position instead of bouncing back up.
Have you tried setting the bounces property to NO?
With the help of interface:
Uncheck the Bounce Vertically property of UITableView
If you want to do it programmatically, you can do it like that:
self.myTableView.alwaysBounceVertical = NO;
You can use the below code with swift 4.x.x
self.myTableView.alwaysBounceVertical = false
Put this line inside viewDidLoad
tableView.bounces = false
swift 5:
self.tableView?.alwaysBounceVertical = false
精彩评论