存在问题
当设置分组的tableView时,使用代理设置section高度
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
return [[UIView alloc] init];
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
return 8;
}
得到结果如下,发现设置的高度并不对,代理1返回的view在底部高度为8是正确的,但是整个的高度偏大
检查后发现是sectionfooterView的高度没有设置,两块连在一起导致高度不正确,所以添加代码,将footerView的高度设为0
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
return [[UIView alloc] init];
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {