0

虽然我试图在基于横向的应用程序 ios6 应用程序中添加导航控制器,但它仅在图像中以纵向模式显示,我应该做些什么改变?在此处输入图像描述

在应用程序委托文件编码中,

 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];
4

1 回答 1

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;
}
于 2012-12-17T12:01:03.903 回答