• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Need help with screen orientation on iOS (app rejected)

Contributor ,
Nov 03, 2011 Nov 03, 2011

Copy link to clipboard

Copied

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.

TOPICS
Development

Views

5.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Nov 04, 2011 Nov 04, 2011

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

Votes

Translate

Translate
LEGEND ,
Nov 03, 2011 Nov 03, 2011

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 04, 2011 Nov 04, 2011

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Nov 04, 2011 Nov 04, 2011

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 04, 2011 Nov 04, 2011

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Nov 04, 2011 Nov 04, 2011

Copy link to clipboard

Copied

YES! haha never heard of that. Thanks!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 04, 2011 Nov 04, 2011

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 04, 2011 Nov 04, 2011

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Nov 04, 2011 Nov 04, 2011

Copy link to clipboard

Copied

@boat5,

has anyone noticed that sometimes it may rotate into portrate for a quick second then snap into landscape? Only sometimes though...

Yes, it is a bit funky on Android. Fell free to file a bug: http://bugbase.adobe.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 04, 2011 Nov 04, 2011

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 04, 2011 Nov 04, 2011

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Nov 04, 2011 Nov 04, 2011

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 04, 2011 Nov 04, 2011

Copy link to clipboard

Copied

I think you made the iPod dizzy.

About later versions, if you have a 3.1 it's beta, and you won't be encouraged to submit an app that uses it. How do you get on with AIR 3.0?

Also, look for more general issues. Like, does it ever crash during normal use?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Nov 04, 2011 Nov 04, 2011

Copy link to clipboard

Copied

I've compiled it to run on 3.0 and the crashing issue has gone away. So now I got to find the new unfixable bugs and pray to god they get fixed in the next version.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 04, 2011 Nov 04, 2011

Copy link to clipboard

Copied

Feel free to mention the other unfixable problems. In fact, feel free to start other topics. I would hate my auto lock suggestion to be the answer to all AIR problems.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Nov 04, 2011 Nov 04, 2011

Copy link to clipboard

Copied

I will

2.6: crashes on compile. known bug. glossed over for the next version stranding me in development for 3 months

2.7.1 timer class horribly inaccurate, as my program uses hundreds of timers it was not fun fixing it

2.7.1 orientation bug crashes the app preventing me from submiting to the app store

3.0 aweful 2.5d performance. Screw it I will live with it. I've about had enough of this.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 05, 2011 Nov 05, 2011

Copy link to clipboard

Copied

Thanks so much for the code you just saved me a sure rejection. Punched it in and it worked like a charm!!! Made it timeline based by getting rid of the private before function and the trace command was missing a quotation mark so just deleted that whole line!!

Thanks for sharing.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 06, 2011 Nov 06, 2011

Copy link to clipboard

Copied

Thanks for sharing, I would have made the mistake for sure!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 15, 2011 Nov 15, 2011

Copy link to clipboard

Copied

Updated, this piece of code works perfectly on iOS devices however not on the Android Lenovo Think Pad, it seemed to be inverted, on landscape view it tried to force it into portrait and vice versa. I ended up getting rid of the code and just setting the app to be in portrait orientation with no auto rotation since Android does not have OCD and does not require this, problem solved but just a heads up to someone trying to use this on Android.

PS it could just be this think pad but its running android 3.1 so how bad can it be?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 15, 2011 Nov 15, 2011

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 15, 2011 Nov 15, 2011

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines