These two pictures should explain it. The first shows my UITableView normally. The second shows when I touch the UISearchBar and it takes focus. Why is there a gap between the cell header and the search bar? Anyone know how to fix this?
iOS 7 is when this occurs by the way. I already have this code:
- (CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
if (tableView == self.searchDisplayController.searchResultsTableView)
{
return 0;
}
else
{
return 23;
}
}


I fixed this problem in my code by removing the following 2 lines of code.
self.viewController.edgesForExtendedLayout = UIRectEdgeNone;
self.navigationBar.translucent = NO;
Hope that leads you in the right direction.
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