How do I make a UITableView stop scrolling
set tableView.alwaysBounceVertical = false;
Bind your table view to a variable called tableView
, then with the following line you can disable the scrolling in Objective-C:
tableView.scrollEnabled = NO;
Swift version:
tableView.isScrollEnabled = false
Set it to YES
(true
), if you want it to be scrollable again.
A UITableView
is a subclass of UIScrollView
. If you tell it to scroll to its current position, it will stop scrolling so this should work for you:
[tableView setContentOffset:tableView.contentOffset animated:NO];