开发者

UITableView Header Problem

I am setting the property of table, tableHeaderView to be hidden, this works and hides the tableHeaderVi开发者_如何学Cew but i also want the table to move up and cover up the space that previously the tableHeaderView was occupying.

Thanks


If you want to hide the tableHeaderView you need to do the following at the place where you want to hide the header,

[yourTableView setTableHeaderView:nil];

This will automatically remove the space which your header view was occupying.


To omit the header and space, use:

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


for that the only thing you have to do is set the height of the header to 0.

Then even if you wont hide the header It will get hidden automatically

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

hAPPY iCODING...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜