I'm using a UISplitViewController for an iPad app and I get a weird behavior from the StatusBar.
Here's how I initialize my RootViewController:
if(kIosVersionFloat >= 7.0)
[application setStatusBarStyle:UIStatusBarStyleLightContent];
[application setStatusBarHidden:NO];
_window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
_rootNavigationVC = [[YTRootNavigationController alloc] init];
_rootNavigationVC.navigationBarHidden = YES;
NSShadow *shadow = [[NSShadow alloc] init];
shadow.shadowColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.8];
shadow.shadowOffset = CGSizeMake(0, 1);
[[UINavigationBar appearance] setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys:
[UIColor colorWithRed:245.0/255.0 green:245.0/255.0 blue:245.0/255.0 alpha:1.0], NSForegroundColorAttributeName,
shadow, NSShadowAttributeName,
[UIFont fontWithName:@"HelveticaNeue-CondensedBlack" size:21.0], NSFontAttributeName, nil]];
// RootViewController* firstVC = [[RootViewController alloc] init];
detailViewController= [[iPadDetailViewController alloc]init];
YTRootNavigationController *navC = [[YTRootNavigationController alloc]init];
[navC pushViewController:detailViewController animated:NO];
navC.navigationBarHidden = YES;
_slidingVC = [[YTBaseViewController alloc] initWithViewClass:[YTSlidingContainerView class]];
[_rootNavigationVC pushViewController:_slidingVC animated:NO];
UISplitViewController* splitVC = [[UISplitViewController alloc] init];
splitVC.viewControllers = [NSArray arrayWithObjects:_rootNavigationVC, navC, nil];
_window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
_window.rootViewController = splitVC;
}
And this is how my app looks like:
I have read a couple other posts on StackOverflow regarding the same issue but didn't get much result.
Any suggestions?
I am not using Storyboards or XIBs