tableview 去除footer高度

来源:互联网 发布:淘宝卖家林弯弯201 编辑:程序博客网 时间:2024/06/06 05:35

tableView Section头部停留在顶部

UITableView的style为Plain的时候,就会出现这种情况,解决办法就是创建的时候选择组的形式

 _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH,self.view.frame.size.height - 64style:UITableViewStyleGrouped];

组的形式会有默认高度

如何去掉header和footer的高度,你只需要组头时就记得设置组尾为0.1

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