-
sectionHeader使用此方法
- ( CGFloat )tableView:( UITableView *)tableView heightForHeaderInSection:( NSInteger )section
{
//對于section == 0 時返回0.01因為 不能返回0 返回0系統(tǒng)會返回自己的默認值
return section == 0 ? 20 : 0.01;
}
-
sectionFooter這個方法無效
- ( float )tableView:( UITableView *)tableView heightForFooterInSection:( NSInteger )section{
return 10.0;
}
需要使用:
self.tableView.sectionFooterHeight = 0;
sectionFooterHeight
這個距離的計算是sectionHeader + sectionFooter
的高度怎顾。
- 同時設(shè)置
self.tableView.sectionFooterHeight = 0;
self.tableView.sectionHeaderHeight = 0;
會徹底把間隔弄走