iOS 11适配

1.UITableView的组头、组尾高度显示异常,设置tableview section header高度无效【iOS 10以下OK,iOS11失效】

// 设置tableview section header高度无效。
// iOS11默认开启Self-Sizing,关闭Self-Sizing即可
self.tableView.estimatedSectionHeaderHeight = 0;
self.tableView.estimatedSectionFooterHeight = 0;

2.UITableView的顶部无法显示到顶。

// iOS11以后需要替换属性设置,关闭系统的自动调整功能
if (@available(iOS 11.0, *)) {
    self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
} else {
    self.automaticallyAdjustsScrollViewInsets = NO;
}

你可能感兴趣的:(iOS 11适配)