I have a UITableView
filled with rows of data. There are only 3 or 4 rows of data which do not reach the bottom of the screen, but the table still bounces vertically as expected when swiping up and down. After adding a UISearchBar
to the top row/header of the UITableView
in Interface Builder, the table no longer bounces initially. However, after navigating to a different view and returning to the same view, the table once again bounces. Why does the UITableView
not bounce when the view is initially loaded, and how do I make it so that it does bounce?
- (void)viewWillAppear:(BOOL)animated {
[table reloadData];
[super viewWillAppear:animated];
}
- (void)viewDidLoad {
...
[table reloadData];
[super viewDidLoad];
}
- (void)viewDidUnload {
...
self.table = nil;
[super viewDidUnload];
}
I was able to solve this problem by implementing the answer on this question.
The key was to add self.tableView.bounces = YES
in the viewDidLoad
method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With