适配 iOS11,避免滚动视图顶部出现20的空白,全局设置了UIScrollView。

if (@available(iOS 11.0, *)) {
  [[UIScrollView appearance] setContentInsetAdjustmentBehavior:UIScrollViewContentInsetAdjustmentNever];
}

 

但是在进入系统界面时,系统界面会出现上移的问题。解决方法在进入系统界面时设置一下方法,

 

if (@available(iOS 11.0, *)) {
  [[UIScrollView appearance] setContentInsetAdjustmentBehavior:UIScrollViewContentInsetAdjustmentAutomatic];
 }

系统界面会调app界面时再设置:UIScrollViewContentInsetAdjustmentNever

 

参考:https://blog.csdn.net/blog_t/article/details/78720946

相关文章:

  • 2021-12-19
  • 2022-12-23
  • 2021-09-25
  • 2022-12-23
  • 2022-12-23
  • 2021-12-16
  • 2022-12-23
  • 2021-07-16
猜你喜欢
  • 2022-12-23
  • 2021-12-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案