-
sectionHeader使用此方法
- ( CGFloat )tableView:( UITableView *)tableView heightForHeaderInSection:( NSInteger )section
{
//对于section == 0 时返回0.01因为 不能返回0 返回0系统会返回自己的默认值
return section == 0 ? 20 : 0.01;
}
-
sectionFooter这个方法无效
- ( float )tableView:( UITableView *)tableView heightForFooterInSection:( NSInteger )section{
return 10.0;
}
需要使用:
self.tableView.sectionFooterHeight = 0;
sectionFooterHeight
这个距离的计算是sectionHeader + sectionFooter
的高度。
- 同时设置
self.tableView.sectionFooterHeight = 0;
self.tableView.sectionHeaderHeight = 0;
会彻底把间隔弄走