Skip to main content
Inspiring
November 4, 2011
Answered

Need help with screen orientation on iOS (app rejected)

  • November 4, 2011
  • 5 replies
  • 5997 views

Hello,

I have a landscape only application which was rejected by Apple. Please read their rejection comment below:

---------------------------------------------------------------------------------------------------------------------------------------

10.1


We found that your app does not comply with the Apple iOS Human Interface Guidelines, as required by the App Store Review Guidelines.


Specifically, we noticed your app only supported the top-left variant of the landscape orientation, but not the top-right variant.


While supporting both variants of both orientations, each with unique launch images, provides the best user experience and is recommended, we understand there are certain applications that must run in the landscape orientation only. In this case, it would be appropriate to support both variants of that orientation in your application, e.g., Home button right and left.


Addressing this issue typically requires only a simple and straightforward code modification. However, if you require assistance, the Apple Developer Support Team is available to provide code-level assistance.

------------------------------------------------------------------------------------------------------------------------------------------

I've wondered about this myself. How can this be fixed? I know there has to be a way.

Thanks for any info you may have.

This topic has been closed for replies.
Correct answer Colin Holgate

I think haven't remembered to turn off the auto-lock on the iPad.

5 replies

November 5, 2011

Funny stuff, but did the code work properly after you turned off the auto lock? Does the rest of your code go inside that orientation code or is that a one time global piece of code that will only listen for the orientation change? Must auto rotation be set to true when publishing out?

Inspiring
November 5, 2011

Yep timothyrandall's code does work exactly as it should as long as you have the auto lock turned off.

But I've got a bigger and scaryer problem now. I turn the iPod upside down and the orientation changes fine, then I flip again, and it works just right, then I flip 2 more times and then POOF! the app shuts down and disappears. I compiled a debug version to see if maybe something in my code went wrong but to no avail.

I'm compiling on 2.7.1

Please don't tell me this is annother "we fixed this in another version" because every time I get my project 99% on a new version, I discover annother show stopper. For instance 3.1 2.5d animations are all messed up and I cannot use it. 2.6 won't even compile as it runs out of memory.

November 15, 2011

Android tablets, at least v3 or later, seem to think that Landscape is default or upside down, and Portrait is rotated left or right. So, you have to do your own screen width and height checking before deciding what to do, and not rely on default being Portrait.


Oh I see. So you set up a variable something like screen width / screen height and if its above 1 you call that landscape and if its less than 1 you call that portrait and then tell the stage how to orient accordingly instead of relying on the default values which seem to work just fine in iOS.

Thanks Colin helpful as always!!!

Inspiring
November 4, 2011

auto lock is flagged as the correct answer to someone browsing the first post

Inspiring
November 4, 2011

I only do this on iOS becuase its required and don't rotate at all on android... but just an observation, when i have tried on android, has anyone noticed that sometimes it may rotate into portrate for a quick second then snap into landscape? Only sometimes though...

Colin Holgate
Inspiring
November 4, 2011

If you are on Android 2.2, or are using the changed event and not the changing event, the interface will have gone to portrait before you can stop it from doing that. I agree, that just dictating that it's in one particular landscape is by far the easiest solution for Android.

Participating Frequently
November 4, 2011

This should work:

stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGING, orientationChange );

private function orientationChange(e:StageOrientationEvent):void {

                              trace(The current orientation is " + e.beforeOrientation + " and is about to change to " +e.afterOrientation);

                              if(e.afterOrientation == StageOrientation.UPSIDE_DOWN || e.afterOrientation == StageOrientation.DEFAULT) {

                                             e.preventDefault();

                                   }

                    }

If you use that code within you app the stage will flip around if you change the landscape orientation, but will ignore any orientation changes that result in a portait position.

Here is a nice article explaining how that all works:

http://www.adobe.com/devnet/flash/articles/screen_orientation_apis.html

Also make sure that you set autoOrients to true within your descriptor.

Inspiring
November 4, 2011

Thanks for your advice. But now I have a really weird problem. The screen will not reorient at all not even in the correct way. I thought it might be your code but it behaves the same with or with out. I thought it might be my application so I made a simple app that does nothing but show text. I set in the descriptor <autoOrients>true</autoOrients> and <aspectRatio>landscape</aspectRatio>.

The orientation never changes when I rotate the device.

I've compiled on air 2.6 and air 2.7.1 with the same result.

What could I be missing?

Colin Holgate
Colin HolgateCorrect answer
Inspiring
November 4, 2011

I think haven't remembered to turn off the auto-lock on the iPad.

Colin Holgate
Inspiring
November 4, 2011

Yes, it's a requirement for iPad apps. If you had an app that had a very good reason to force people to hold their iPad upside down (compared to their preferred way), then you can make a case to Apple. If it just needs to be landscape for layout reasons, then you ought to support both versions of landscape.

One thing though, the splash screen can be fixed to one way or the other, and that seems to be ok, so long once the app is running it spins around to the way the user is holding the iPad.