Description of the problem: with iOS 7 in grouped UITableView
there is a gap between the top of the table view and the first cell.
The strange part is th
Simplest solution to this problem in grouped type tableView
is:
tableView.tableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, self.tableView.bounds.size.width, 0.01f)];
For me this didn't work
self.automaticallyAdjustsScrollViewInsets = NO;
This only caused the table view to sit under the NavigationBar.
What worked for me was to go into my storyboard, and resize my tableView. It seems my tableView had a 20px gap at the top to allow for the statusBar. I scaled it and everything lined up perfectly.
guys! I had the same problem. TableView appeared with free space between nav bar and first cell. This code saved me:
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
if (section == 0) {
return 10;
}
else return 2;
}