IOS11以后,如何调整UITableView的section的高度

来源:互联网 发布:域名分析工具 编辑:程序博客网 时间:2024/05/29 11:34

IOS11以后,当我们的UITableView的风格设置为UITableViewStyleGrouped,如果我们要想调整

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

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section

这2个方法的时候,我们必须实现以下两个代理方法,

- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {    return [[UIView alloc] init];}

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {    return [[UIView alloc] init];}

令其返回2个view来进行填充。

原创粉丝点击