旋转不适用于iOS-6.0及以上版本
问题描述:
我准备了一个名为“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