IOS 8.1 auto rotation
In my project, I check all types of orientation that I need!
This works great on iOS 7.1, but it doesn't work as expected for iOS 8.1. In iOS 8.1, when I open the app in portrait or landscape mode, it works fine, but when used in the middle, I rotate my device, only the status bar changes rotation! How can I fix this?
source to share
I had the same problem for many days and got a response from ChrisJP's link .
appdelegate.m
, comment out the following code in your app didFinishLaunchingWithOptions
.
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
Here is the text from the link (in case of expiration or people don't want to register on the developer forums):
"I managed to fix it!
I'm assuming you guys are using storyboards too? If so, you probably have some old remainder code in your app delegate, when you weren't using storyboards, it turns out that this is no longer needed when storyboards are used, but until 8.1 has no effect.
-
Make sure your navigation controller (or whatever you are using) is set as "Start View Controller" in your storyboard
-
In the appdelegate.m file, remove any references to the UIWindow and rootViewController that appear in the didFinishLaunchingWithOptions application. For me, I still had the following two lines, which, after deletion, fixed my problems:
self.window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen])]; [self.window makeKeyAndVisible];
and also i was setting self.window.rootViewController. It also doesn't need to be installed unless you override it for some reason.
What I fixed this for me, hopefully this for you guys too. "
source to share