博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
设置section的距离
阅读量:6994 次
发布时间:2019-06-27

本文共 542 字,大约阅读时间需要 1 分钟。

在ios7中使用group类型的tableview时,第一个section距离navigationbar的距离很大,不符合这边的设计图。使用 myTableView . sectionHeaderHeight = 8.0无效。 于是通过各种方法测试,终于得到解决方法。就是通过设置tableview的headerview高度来控制这个距离。使用的方法是:

- ( CGFloat )tableView:( UITableView *)tableView heightForHeaderInSection:(NSInteger )section

{

    return 8.0 ;

}

但对于第一个和第二个section之间的距离设置则不能使用- ( float )tableView:(UITableView *)tableView heightForFooterInSection:( NSInteger )section这个方法。需要使用

myTableView . sectionFooterHeight = 1.0。 这个距离的计算是header的高度加上footer的高度。

转载于:https://www.cnblogs.com/yulang314/p/3792839.html

你可能感兴趣的文章