问题
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