iOS 11适配

2017-10-12  本文已影响10人  798798123

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

猜你喜欢

热点阅读