How to remove the blank space at the top of a grouped UITableView?

后端 未结 8 1142
南旧
南旧 2020-12-08 20:12

When you create a UITableView with the UITableViewStyleGrouped style, it adds quite a lot of space in between the actual tableviewcells and the bor

8条回答
  •  孤城傲影
    2020-12-08 20:56

    You need to set footer too

    -(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
      return 0;
    }
    
    -(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
      return [[UIView alloc] initWithFrame:CGRectZero];   
    }
    

提交回复
热议问题