关于iPhone X适配的一些问题

2018-02-07  本文已影响21人  mqw
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
    make.top.left.right.bottom.mas_offset(0);
}];

当iOS11的时候

//适配X
 if (@available(iOS 11.0, *)) {
    self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentAutomatic;
 } else {
     self.automaticallyAdjustsScrollViewInsets = NO;
 }

这里特别要注意的是,使用UIScrollViewContentInsetAdjustmentAutomatic,而不是`UIScrollViewContentInsetAdjustmentNever,否则的话底部会出现遮挡的问题。

上一篇 下一篇

猜你喜欢

热点阅读