开发者

Disable UITableView vertical bounces when scrolling

开发者 https://www.devze.com 2022-12-29 07:45 出处:网络
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 UITableV

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

Disable UITableView vertical bounces when scrolling


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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号