removing invisible header from ipad tableview

Posted by Cœur on Stack Overflow See other posts from Stack Overflow or by Cœur
Published on 2012-11-12T16:11:11Z Indexed on 2012/11/12 17:00 UTC
Read the original article Hit count: 369

Filed under:
|
|

my UITableView has some kind of invisible header / inset on iPad and not on iPhone.

iphone tableView ipad tableView

I tried all the following to remove this unwanted header/inset, with no success:

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.tableview.sectionHeaderHeight = 0.f;
    self.tableview.sectionFooterHeight = 0.f;
    self.tableview.tableHeaderView = nil;
    self.tableview.tableFooterView = nil;
    self.tableview.contentInset = UIEdgeInsetsZero;
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 0.f;
}

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
    return 0.f;
}

- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
    return @"";
}

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    return [[[UIView alloc] initWithFrame:CGRectNull] autorelease];
}

- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
    return [[[UIView alloc] initWithFrame:CGRectNull] autorelease];
}

© Stack Overflow or respective owner

Related posts about iPad

Related posts about header