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

后端 未结 20 2045
既然无缘
既然无缘 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 07:51

    edgesForExtendedLayout does the trick for iOS 7. However, if you build the app across iOS 7 SDK and deploy it in iOS 6, the navigation bar appears translucent and the views go beneath it. So, to fix it for both iOS 7 as well as for iOS 6 do this:

    self.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;
    if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
        self.edgesForExtendedLayout = UIRectEdgeNone;   // iOS 7 specific
    

提交回复
热议问题