How to apply top offset for status bar in iOS7 for UITabBarController children only

后端 未结 2 1809
醉话见心
醉话见心 2021-01-18 05:27

My app is a UITabBarController based app with 3 children vc. The status bar is overlapping with my viewcontrollers. I have tried everything I have found in SO:

    <
相关标签:
2条回答
  • 2021-01-18 06:14

    for iOS 7 and xcode 5 to avoid overlapping

    use in

    viewDidLoad method

    self.edgesForExtendedLayout = UIRectEdgeNone;
    self.automaticallyAdjustsScrollViewInsets = NO;
    
    0 讨论(0)
  • 2021-01-18 06:26

    Well, I have the same problem as you. I fixed it with many moves. I use ruby motion:

    @window.bounds = CGRectMake(0, -20, UIScreen.mainScreen.bounds.size.width, UIScreen.mainScreen.bounds.size.height - 20)
    @window.frame = CGRectMake(0, 0, UIScreen.mainScreen.bounds.size.width, UIScreen.mainScreen.bounds.size.height)
    ....
    tabBarController.view.bounds = CGRectMake(0, 20, UIScreen.mainScreen.bounds.size.width, UIScreen.mainScreen.bounds.size.height - 20)
    

    Let me know how it's going at your end.

    update: attach the screenshot:enter image description here

    0 讨论(0)
提交回复
热议问题