标头意外显示在iOS 10及更低版本中的所有视图控制器中 [英] a header unexpectedly shows up in all view controllers in iOS 10 and lower

查看:88
本文介绍了标头意外显示在iOS 10及更低版本中的所有视图控制器中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的所有视图控制器和约束在iOS 11及更高版本中都可以,但在iOS 10及以下版本中,所有页面(如以下图片)中都创建了一个空格:

all my view controllers and constraints are fine in iOS 11 and above but in iOS 10 and below a space created in all pages like the pictures below :

我什至尝试了在具有四个安全区域约束的viewcontroller中使用简单的Web视图,但是得到了相同的结果(iOS 11及更高版本中的视图良好,iOS 10及更低版本中的顶部空间.另一个奇怪之处问题是我的某些应用程序现在有此问题,而有些则没有:|.我该怎么办?

I tried even a simple web view in a viewcontroller with four constraints to safe area but I've got the same result.(good view in iOS 11 and above and a space to top in iOS 10 and below. and another strange thing is that some of my apps now have this problem and some don't :| . what should I do?

推荐答案

可以尝试吗?

if #available(iOS 11.0, *) {
    scrollView.contentInsetAdjustmentBehavior = .never
} else {
    self.automaticallyAdjustsScrollViewInsets = false
}

注意:如果使用的是(tableView,collectionView)而不是scrollview.

Note: Use (tableView, collectionView) instead of scrollview if you are using one.

这篇关于标头意外显示在iOS 10及更低版本中的所有视图控制器中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆