首页 > 技术文章 > tableview 分组显示返回footerviewt和headerView的高度不能为0的问题

JerryBaxia 2015-11-25 09:58 原文

IOS不允许Header和Footer为0

但有时为方便写代码还是要有设置为0的时候,那么这时可以设置为0.0001,这样也就显示不出来了

-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
 if(section == 1 )
  return 0.000001f;
 else return 44.0f; // put 22 in case of plain one..
}

  

推荐阅读