我準備了一個名爲「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中進行自動旋轉?
謝謝!
請查看http://dhilipsiva.blogspot.in/2012/07/ios-6-ui-interface-orientation.html – krishh 2013-04-23 09:09:49
我已經添加了iOS-6所需的方法。 1)shouldAutorotate 2)supportedInterfaceOrientations – NSS 2013-04-23 10:16:33