В heightForFooterInSection
проверить секцию и вернуть соответствующее значение.И вернуть прозрачный UIView
в viewForFooterInSection
.
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
if (section == 0) {
return 0;
} else {
return 10;
}
}
-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
UIView *footer = [[UIView alloc] init];
[footer setBackgroundColor:[UIColor clearColor]];
return footer;
}
Чтобы добавить верхнее пространство для первого заголовка
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
//setup header view
if (section == 0) {
view.frame = CGRectMake(0, 0, tableView.frame.size.width, 55);
button.frame = CGRectMake(0, 10, tableView.frame.size.width, 45);
} else {
view.frame = CGRectMake(0, 0, tableView.frame.size.width, 45);
button.frame = CGRectMake(0, 0, tableView.frame.size.width, 45);
}
return view;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
if (section == 0) {
return 55;
} else {
return 45;
}
}