在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的高度。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
  • 2022-01-17
猜你喜欢
  • 2022-12-23
  • 2021-10-09
  • 2021-11-11
  • 2022-12-23
  • 2021-10-02
  • 2021-08-17
  • 2021-10-19
相关资源
相似解决方案