iOS 11 safe area layout guide backwards compatibility

前端 未结 16 1157
忘了有多久
忘了有多久 2020-12-02 05:42

Is enabling Safe Area Layout Guides compatible to iOS below 11?

16条回答
  •  星月不相逢
    2020-12-02 06:21

    I was using this in Objective-C when I had a Navigation Bar in my UIView and had good results for iOS 10. In case you use SafeArea in your xib then you may add in your viewDidLoad:

    if (@available(iOS 11.0, *)) {}
    else {
        self.edgesForExtendedLayout = UIRectEdgeNone;
    }
    

提交回复
热议问题