Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 8 - App not rotating appropriately

Tags:

ios

rotation

ios8

I have an app originally developed for iOS 7.1 that I am now testing on an iPad through Xcode 6.1. When running on an iPad running 7.1 or in the 7.1 simulator the app functions as expected. On the 8.1 iPad or 8.1 simulator, it appears as though rotation is not handled appropriately. I see the status bar at the top rotate, but the app itself does not change. I understand that this is related to rotation methods being deprecated in iOS 8. My question is... now what???

I haven't found any documentation that provides a concise answer for how to handle rotation using the new iOS 8 mechanisms. Is there any way to gracefully handle rotations in iOS 8 the same way I handled them in iOS 7? I don't even see the old rotation methods being called, so it appears as though this is more than a typical "deprecation". It seems as though they've eliminated calls to these methods altogether.

Any help or advice?

like image 719
Shadowman Avatar asked Oct 24 '14 17:10

Shadowman


People also ask

Why won't some apps rotate on my iPhone?

Some apps don't support rotation, so your screen might not rotate even if Portrait Orientation Lock isn't turned on.

How do I fix my iPhone app that is sideways?

Swipe down from the top-right corner of your screen to open Control Center. Tap the Portrait Orientation Lock button to make sure that it's off.

Why won't my apps turn sideways?

You'll find this setting in the Quick Settings menu. If you see Auto rotate highlighted in blue, then auto rotate is turned on. If you don't see Auto rotate, but there's a Portrait icon instead, auto rotate is disabled. Tap Portrait to turn on auto rotate.

Why do some apps not rotate iPad?

Remember that not all apps support rotation. If some apps on your iPad rotate as expected and others don't rotate, the ones that don't were built that way by their developers.


2 Answers

Are you using storyboards? If so, you may have old code in your application didFinishLaunchingWithOptions method.

Try removing the following line of code and any others to do with UIWindow:

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

Others have said to remove lines from your plist file but that shouldn't be necessary.

like image 195
ChrisJP Avatar answered Oct 17 '22 04:10

ChrisJP


I had a similar problem and I fixed it by removing the UIMainStoryboardFile and UIMainStoryboardFile~ipad keys from app's information property list

Give a look to this discussion https://devforums.apple.com/message/1064397#1064397

like image 30
Fabrice Avatar answered Oct 17 '22 04:10

Fabrice