我设置页脚高度 0.0 仍然显示在 uitableview 中

use*_*053 0 uitableview ios

为什么采用页脚视图?

-(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;
}
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

Sno*_*man 5

将高度设置为 0.01,而不是 0.0。