使用grouped的tableView的时候,第一个section距离navigationbar的距离很大。使用 myTableView . sectionHeaderHeight = 1.0无效。 有效的方法是:
- ( CGFloat )tableView:( UITableView *)tableView heightForHeaderInSection:(NSInteger )section
{
return 1.0 ;
}
但对于第一个和第二个section之间的距离设置则不能使用- ( float )tableView:(UITableView *)tableView heightForFooterInSection:( NSInteger )section这个方法。需要使用
myTableView . sectionFooterHeight = 1.0。 这个距离的计算是header的高度加上footer的高度。