UINavigationController within ViewController, gap at top of view

后端 未结 11 990
不知归路
不知归路 2021-02-04 03:24

I\'m working on a universal app, and I\'m trying to share as much code as possible between the iPhone and iPad versions. I need to use a TabBarController as my root view contro

11条回答
  •  清酒与你
    2021-02-04 03:50

    In my view that is displayed inside the navigationcontroller I put this code inside the viewDidAppear

    This code may not be perfect for every application but it fixed my issue I spent several hours kicking at..

        // START OF BUG FIX FOR iOS
    if (self.navigationController.navigationBar.frame.origin.y ==20) {
        // Move the navigation Bar up
        [self.navigationController.navigationBar setFrame:CGRectMake(0, 0, self.navigationController.navigationBar.frame.size.width, self.navigationController.navigationBar.frame.size.height)];
        // move up the table view
         [self.view setFrame:CGRectMake(0, -20, self.view.frame.size.width, self.view.frame.size.height+20)];
    }
    // END OF BUG FIX for IOS6
    

提交回复
热议问题