-1
我试图在应用程序委托中以编程方式创建窗口,但隐藏了状态栏。在info.plist中它没有被设置为YES。这款应用完全可以工作,但我也需要显示状态栏。在这里AppDelegate.h 我有窗口和navigationController属性是我didFinishLaunchObjective-C:以编程方式创建窗口时隐藏状态栏
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
//even when I used customized CGRect and used it initWithFrame, there is no status bar
self.navigationController = [[IEENavigationController alloc] init];
XYZViewController *homeViewController = [[XYZViewController alloc] initWithNibName:@"XYZViewController" bundle:nil];
[navigationController pushViewController:homeViewController animated:YES];
self.window.rootViewController = self.navigationController;
[window addSubview:navigationController.view];
[self.window makeKeyAndVisible];
return YES;
预先感谢您
谢谢lain,但它没有工作 – Hadis 2014-10-05 21:06:03
在info.plist中是否将UIStatusBarHidden设置为YES? – 2014-10-05 21:12:17
不,它是NO,状态栏最初被隐藏设置为NO。 – Hadis 2014-10-05 21:47:14