在ios7中使用group
類型的tableView
時(shí)锅劝,第一個(gè)section
距離navigationBar
的距離很大,不符合這邊的設(shè)計(jì)圖诬垂。使用 tableView.sectionHeaderHeight = 8.0
無(wú)效。 于是通過(guò)各種方法測(cè)試喉磁,終于得到解決方法确买。就是通過(guò)設(shè)置tableView
的headerview
高度來(lái)控制這個(gè)距離派草。使用的方法是:
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:( NSInteger )section {
return 8.0;
}
但對(duì)于第一個(gè)和第二個(gè)section
之間的距離設(shè)置則不能使用heightForFooterInSection
這個(gè)方法鉴竭。需要使用
tableView . sectionFooterHeight = 1.0
。 這個(gè)距離的計(jì)算是header
的高度加上footer
的高度。