iOS11 cell 间距拉伸问题

在 iOS11时,当我们在使用 tableView 进行分组时( style:UITableViewStyleGrouped)会出现 cell 组间距被拉伸的情况,如下图:

iOS11 cell 间距拉伸问题_第1张图片
左为 iOS 11之前,右为 iOS 11之后

决绝方案: 添加一下两个代理方法;

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

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

你可能感兴趣的:(iOS11 cell 间距拉伸问题)