当我尝试在基于横向的应用程序ios6应用程序中添加导航控制器时,它仅在图像模式下显示,就像在图像中一样,我应该做出哪些更改?
在app委托文件编码中,
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
navigationController = [[UINavigationController alloc] initWithRootViewController:self.viewController];
[self.window addSubview:[navigationController view]];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
答案 0 :(得分:1)
选中此选项可在您的应用中添加UINavigationController
:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// start of your application:didFinishLaunchingWithOptions
// ...
viewController = [[ViewController alloc]init];
UINavigationController *navigationController = [[UINavigationController alloc]initWithRootViewController:viewController];
[self.window setRootViewController:navigationController];
[window makeKeyAndVisible];
[viewController release];
[navigationController release];
return YES;
}