user3279053
user3279053

Reputation: 187

i setted footer height 0.0 still showing in uitableview

Why its taking footer view?

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


-(CGFloat)tableView:(UITableView*)tableView heightForFooterInSection:(NSInteger)section
{
    return 0.0;
}

-(UIView*)tableView:(UITableView*)tableView viewForHeaderInSection:(NSInteger)section
{
    UIView *view=[[UIView alloc] initWithFrame:CGRectZero];
    view.backgroundColor=[UIColor redColor];
    return view;
}

-(UIView*)tableView:(UITableView*)tableView viewForFooterInSection:(NSInteger)section
{
    UIView *view=[[UIView alloc] initWithFrame:CGRectZero];
    view.backgroundColor=[UIColor yellowColor];
    return view;
}

enter image description here

Upvotes: 0

Views: 1356

Answers (1)

Snowman
Snowman

Reputation: 32061

Set the height to 0.01, not 0.0.

Upvotes: 5

Related Questions