Reputation: 899
I want to disable any scroll bouncing on my UITableView. For now I do it like that:
myTableView.bounces = NO;
But when I scroll to bottom of my list my content dont stop but back a little bit. How to disable this?
Upvotes: 4
Views: 6937
Reputation: 665
UITableview is inherited form UIScrollview.So simply use the scroll view delegates.We can do the same things which we are doing for a scrollview.Please correct me if am wrong.
Upvotes: 3
Reputation: 2648
-(void)scrollViewDidScroll:(UIScrollView *)scrollView
{
if (scrollView.contentOffset.y<=0) {
scrollView.contentOffset = CGPointZero;
}
}
Upvotes: 5
Reputation: 3026
UITableView is a subclass of UIScrollView. UIScrollView has a property you can set to stop the bouncing.
In fact there are two you could use:
set the BOOL
value of bounces
to NO
.
set the BOOL
value of alwaysBounceVertical
to NO
.
Here's the link to the docs.
Upvotes: 2
Reputation: 525
Just uncheck the Bounce Vertically property of UITableView
This can also be done programmatically by setting the alwaysBounceVertical property to NO
Upvotes: 9