iOS11 cell 间距拉伸问题

2017-10-09  本文已影响136人  明月钓无痕

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

左为 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];
}
上一篇 下一篇

猜你喜欢

热点阅读