1

I have the following hierarchy in my app: UITabBarController (rootviewcontroller) --> Custom UINavigationController --> View1 (UIViewController)

After updating to iOS9, Initially when app launches , the View 1 is shifted a bit below the status bar as below:

shifted below

Also, the viewwillappear doesn't get called by default. The custom navigation bar delegate methods are used within the custom class, no other delegate is used anywhere. Also I have used RXCustomTabar as the rootview. Help!

Tripti Kumar
  • 1,559
  • 14
  • 28

1 Answers1

0

Follow the below steps

1.In yourproject - info.plist

 Status bar is initially hidden  Boolean  YES

2.After that you need to do is in didFinishLaunchingWithOptions of AppDelegate.m

[UIApplication sharedApplication].statusBarHidden=NO;
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) 
{
    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault];
    [application setStatusBarHidden:NO];
    self.window.clipsToBounds=YES;
    self.window.frame =  CGRectMake(0,20,self.window.frame.size.width,self.window.frame.size.height-20);
}
else
{
    self.window=[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
    [application setStatusBarHidden:NO];
    self.window.clipsToBounds=YES;
    self.window.frame =  CGRectMake(0,20,self.window.frame.size.width,self.window.frame.size.height-20);

}

If you follow the above steps, you don't need to write the code in viewWillAppear of every view controller.

user3182143
  • 9,459
  • 3
  • 32
  • 39