Status bar and navigation bar appear over my view's bounds in iOS 7

后端 未结 20 1645
既然无缘
既然无缘 2020-11-22 07:09

I recently downloaded Xcode 5 DP to test my apps in iOS 7. The first thing I noticed and confirmed is that my view\'s bounds is not always resized to account for the status

相关标签:
20条回答
  • 2020-11-22 08:06

    Swift 3 / Swift 4 solution that also works with NIBs/XIB files in iOS 10+:

    override func viewDidLoad() {
        super.viewDidLoad()
    
        edgesForExtendedLayout = []
    }
    
    0 讨论(0)
  • 2020-11-22 08:07

    just set the following code in view will appear.

      if ([[[UIDevice currentDevice] systemVersion] floatValue]<= 7) {
    self.edgesForExtendedLayout = UIRectEdgeNone;
     }
    
    0 讨论(0)
提交回复
热议问题