简体   繁体   English

ios6视图控制器自动旋转

[英]ios6 view controller autorotate

I have recently released an app on the app store and when developing it, on iOS 5, autorotate was working fine and as I wanted it to. 我最近在应用商店上发布了一个应用,在开发它时,在iOS 5上,autorotate可以正常工作,并且按我的意愿运行。 When it was released on the app store I then downloaded it to make sure the version was working correctly, but this time with iOS 6, and the autorotate is all messed up. 当它在应用商店中发布时,我随后下载了它以确保该版本运行正常,但是这次是在iOS 6上,并且自动旋转功能全部搞砸了。

After some searching, I found that they deprecated the shouldAutorotateToInterfaceOrientation function. 经过一番搜索,我发现他们不赞成使用shouldAutorotateToInterfaceOrientation函数。 So I tried using the new supportedInterfaceOrientations or shouldAutorotate with no luck whatsoever. 因此,我尝试使用新的supportedInterfaceOrientationsshouldAutorotate ,但没有任何运气。 Does anyone know how to fix this so that my rotates works properly. 有谁知道如何解决此问题,以便我的旋转正常工作。 I want specific screens to only be in portrait and some to be able to do both landscape and portait, and this worked fine with shouldAutorotateToInterfaceOrientation , I need a new method that will work in iOS 6. 我想具体的屏幕仅在纵向和一些人能够做到横向和波泰特,这工作得很好用shouldAutorotateToInterfaceOrientation ,我需要一个将在iOS 6中工作的新方法。

Thanks for any help in advance! 感谢您的任何帮助!

In your app delegate, are you adding your navigation controller's view as a subview in self.window? 在您的应用程序委托中,您是否将导航控制器的视图添加为self.window中的子视图? If so, I found that this did not work correctly in iOS version 6. You should instead set the self.window root view controller. 如果是这样,我发现这在iOS版本6中无法正常工作。您应该设置self.window根视图控制器。 Here are some more specifics: 以下是一些更具体的内容:

http://www.dosomethinghere.com/2012/09/24/the-app-delegates-uiwindow-is-finicky/ http://www.dosomethinghere.com/2012/09/24/the-app-delegates-uiwindow-is-finicky/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM