2013-04-23 43 views
1

我準備了一個名爲「CncWindowController」的視圖控制器文件,並在XIB文件中,我將窗口對象(而不是UIView)連接到視圖插座。所以當我訪問它的視圖時,我得到了窗口對象。旋轉不適用於iOS-6.0及以上版本

我訪問喜歡在AppDelegate.m文件:

self.windowController = [[CncWindowController alloc] initWithNibName:@"CncWindowController" bundle:nil]; 
self.window = (UIWindow*) self.windowController.view; 

這裏,觀點實際上是指窗口。但是Rotation在iOS6.0中不起作用,並且shouldAutorotate方法也未被調用。

如果我將使用下面的窗口對象,那麼它工作正常: self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

我的方法有什麼問題?任何想法的幫助我應該如何使用上述方法在iOS-6中進行自動旋轉?

謝謝!

+0

請查看http://dhilipsiva.blogspot.in/2012/07/ios-6-ui-interface-orientation.html – krishh 2013-04-23 09:09:49

+0

我已經添加了iOS-6所需的方法。 1)shouldAutorotate 2)supportedInterfaceOrientations – NSS 2013-04-23 10:16:33

回答

1

請訪問此鏈接瞭解有關旋轉如何在iOS6中工作的完整信息。 http://buddingdevelopers.com/autorotation-in-ios/

+0

我無法打開鏈接:http://buddingdevelopers.com/autorotation-in-ios/ – NSS 2013-04-26 05:45:01

+0

oops。該網站似乎有問題。但它現在看起來很健康:) – Xcoder 2013-04-26 13:25:12

相關問題