我正在为 iPad 应用程序使用 UISplitViewController,我从 StatusBar 得到一个奇怪的行为。
这是我初始化 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;
}
这就是我的应用程序的样子:
我已经阅读了 StackOverflow 上关于同一问题的其他几篇文章,但没有得到太多结果。
有什么建议么?
我没有使用 Storyboard 或 XIB