更新Xcode到最新版本Xcode9,运行以前的项目,发现这么一个bug,如图所示:

iOS11设置automaticallyAdjustsScrollViewInsets失效

Command选中点击进去发现,这个属性已经过期了

iOS11设置automaticallyAdjustsScrollViewInsets失效

而且是用了新属性contentInsetAdjustmentBehavior来代替。

因此,要做个版本判断:

if (@available(iOS 11.0, *)) {

        _scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;

    }else {

        self.automaticallyAdjustsScrollViewInsets = NO;

    }



相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-03
  • 2021-07-11
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2018-05-13
  • 2021-08-29
  • 2021-08-11
  • 2021-05-20
相关资源
相似解决方案