美文网首页
UITableView的类型为group时,多出来一片空白

UITableView的类型为group时,多出来一片空白

作者: 柚子姑娘666 | 来源:发表于2018-09-29 16:21 被阅读0次

1.第一个section上边多余间距处理

// 隐藏UITableViewStyleGrouped上边多余的间隔_tableView.tableHeaderView = [[UIViewalloc] initWithFrame:CGRectMake(0,0,0,CGFLOAT_MIN)];

2.代码顺序的不同导致第一个section上边出现多余间距

在设置代理前设置tableFooterView,上边会出现多余间距

错误示例:

tableView = [[UITableViewalloc]initWithFrame:CGRectZerostyle:UITableViewStyleGrouped];

tableView.tableFooterView = [UIView new];

tableView.delegate =self;

tableView.dataSource =self;

正确示例:

tableView = [[UITableViewalloc]initWithFrame:CGRectZerostyle:UITableViewStyleGrouped];

tableView.delegate =self;

tableView.dataSource =self;

tableView.tableFooterView = [UIView new];

相关文章

网友评论

      本文标题:UITableView的类型为group时,多出来一片空白

      本文链接:https://www.haomeiwen.com/subject/tikboftx.html