2012-12-17 41 views
0

虽然我试图添加导航控制器在基于横向的应用程序ios6应用程序,它只在肖像模式中显示,就像在图像中,我应该做什么改变? enter image description here如何添加横向导航控制器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]; 

回答

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; 
} 
+0

完美:)感谢队友 – Fazil

相关问题