2012-12-17 78 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

相關問題