简体   繁体   中英

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. 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.

After some searching, I found that they deprecated the shouldAutorotateToInterfaceOrientation function. So I tried using the new supportedInterfaceOrientations or shouldAutorotate with no luck whatsoever. 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.

Thanks for any help in advance!

In your app delegate, are you adding your navigation controller's view as a subview in 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. Here are some more specifics:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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