今天有个小问题困扰了我一阵子,一段时间没用UITableViewStyleGrouped的tableview了难免忘记了
设置section的头部高度不能为0或0.0等 需要设置非常少的数值例如0.01,0.001等
image.png
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return 0.001;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return 0.001;
}
顶部间距消失
image.png