a header unexpectedly shows up in all view controllers in iOS 10 and lower

廉价感情. 提交于 2019-12-13 03:56:18

问题


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 :

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?


回答1:


Can you try this?

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

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



来源:https://stackoverflow.com/questions/53635727/a-header-unexpectedly-shows-up-in-all-view-controllers-in-ios-10-and-lower

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!