iOS-UITableView使用UITableViewStyl

2016-03-25  本文已影响1208人  MonsterNanny
- ( CGFloat )tableView:( UITableView *)tableView heightForHeaderInSection:( NSInteger )section
{
//对于section == 0 时返回0.01因为 不能返回0 返回0系统会返回自己的默认值
       return section == 0 ? 20 : 0.01;
}
- ( 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; 

会彻底把间隔弄走

上一篇 下一篇

猜你喜欢

热点阅读