UITableView does not bounce / scroll after adding UISearchBar to view

I have a UITableView populated with data rows. There are only 3 or 4 rows of data that do not reach the bottom of the screen, but the table still bounces vertically, as expected, when scrolling up and down. After adding a UISearchBar to the top row / header of a UITableView in Interface Builder, the table no longer bounces initially. However, moving to a different view and returning to the same view, the table bounces again. Why doesn't the UITableView bounce when the view is initially loaded, and how can I make it bounce?

 - (void)viewWillAppear:(BOOL)animated { [table reloadData]; [super viewWillAppear:animated]; } - (void)viewDidLoad { ... [table reloadData]; [super viewDidLoad]; } - (void)viewDidUnload { ... self.table = nil; [super viewDidUnload]; } 
+4
source share
1 answer

I was able to solve this problem by completing the answer to this question .

The key was to add self.tableView.bounces = YES to the viewDidLoad method.

+9
source

All Articles