31
votes

How do I disable the bounce effect when vertically scrolling a UITableView? Right now if I scroll anywhere near the bottom, the view scrollbar bounces right up. I would like my UITableView to stay fixed at the scrolled-to position instead of bouncing back up.

5
This will lead to a confused user. I for one hate this behavior. Normal UITableView s bounce, so why shouldn't this one do so, too.bddckr
@bddckr I have an issue with your comment... Allow me to explain; in my case, I'm using a UITableView for it's convenience methods in displaying data, however, my implementation will not look like, nor feel like a UITableView - so I for one, won't be confusing users; likewise, I'm also adhering to a corporate style (enterprise app), where all users will be familiar with the functions of various UI elements anyway. If you convince people not to change the norm, you'll find a lack of innovation - true creativity and innovation comes from challenging conventions.Dan Hanly
@danielhanly.com I can see that in an enterprise app this won't confuse users, but still: I can't see how disabling animations that help the user understand where content ends benefits the user. Care to explain? I can also see UITableView being used without letting the user interact with it, so my comment from 2010 certainly needs some more explanation. :)bddckr
@bddckr :) yeah, I didn't look to offend, but my point was that Apple's standard components only work when they're used for the exact reason that Apple intended. There are many ways to utilise these components for other uses too, and that's where customisation in this way comes into play. If you're not using a UITableView to act like a UITableView, then it doesn't need to follow Apple's conventions. Also, hadn't read the date on your comment so this probably feels like Necromancy, so I apologise ;)Dan Hanly

5 Answers

43
votes

Have you tried setting the bounces property to NO?

28
votes

With the help of interface:

Uncheck the Bounce Vertically property of UITableView

enter image description here

3
votes

If you want to do it programmatically, you can do it like that:

self.myTableView.alwaysBounceVertical = NO;
3
votes

You can use the below code with swift 4.x.x

self.myTableView.alwaysBounceVertical = false
1
votes

swift 5:

self.tableView?.alwaysBounceVertical = false