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

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];

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容