IOS 8.1 auto rotation

In my project, I check all types of orientation that I need!

orientations

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?

+3


source to share


4 answers


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

+10


source


In my case, I was creating my storyboard programmatically, but then I was still referencing the storyboard in the project settings. Incorrect position of the "Main Interface" field in the deployment settings resolves the problem.



+1


source


Can you check your Xcode version? this could be a problem

iOS 8: Autorotation doesn't work without storyboarding

0


source


I also had this exact issue when upgrading to iOS 8.1. If your app doesn't use storyboard, it can be solved by removing the link Main storyboard file base name

in info.plist file

or when opened as source

<key>UIMainStoryboardFile</key>
<string>Main</string>

      

0


source







All Articles