iOS学习-UITableView设置heightForFooterInSection无效以及tableview底部UITableViewHeaderFooterView默认有个浅灰色背景

1、针对heightForFooterInSection设置无效

需要在初始化tableview的时候加上self.tableView.sectionFooterHeight = 8;//设置自己要的高度

2、tableview底部UITableViewHeaderFooterView默认有个浅灰色背景

这里在代理中设置一个UIView即可

- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
    UIView *view =[[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 1)];
    view.backgroundColor = [UIColor clearColor];
    return view;
}

猜你喜欢

转载自blog.csdn.net/qq_43441647/article/details/130525190