tableview 里面的 必须配套使用的方法

时间:2022-06-02 08:56:48

1: 如果不配套的先给出  footer的高度,那么  即时有view 可能也显示不出来

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {

if (section == 1) {

return 35+45;

}

else

return 0.00001;

}

- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {

if (section == 1) {

UIView *v = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 3500+45)];

v.backgroundColor = [UIColor blackColor];

return v;

}else{

return nil;

}

}