小编use*_*053的帖子

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

为什么采用页脚视图?

-(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)

在此输入图像描述

uitableview ios

0
推荐指数
1
解决办法
1285
查看次数

标签 统计

ios ×1

uitableview ×1