Skip to main content
Inspiring
July 31, 2013
Question

setting aspect ratio to landscape doesnt always work correctly.

  • July 31, 2013
  • 1 reply
  • 602 views

I am building an app for both Android and iOS... I am testing on an iPad2 and a Nexus tablet (for iOS and android). 

In my -app.xml, I have  <aspectRatio>ANY</aspectRatio> and <autoOrients>true</autoOrients.

I allow the app to auto-orient to any position. There is an exception... 1 part of my app I need to be "LANDSCAPE" only, and then when leaving that part I want to resume the "ANY"

Depending on the current orientation, telling the app to "stage.setAspectRatio(StageAspectRatio.LANDSCAPE)" yield different results.

When my apps orientation is "default" or "upsideDown", it works correctly. (basically its going from portrait to landscape)

When my apps orientation is "rotatedRight", it works correctly (even though the "rotateRight" state is already landscape).

When my apps orientation is "rotatedLeft", it does NOT work correctly. It does indeed make the app landscape (even though its already landscape), but it forces the app to do a 180 flip, and my content is upside down.

Has anyone else experienced anything like this? I have a feeling this will get no replies and fade away into the interwebs

This topic has been closed for replies.

1 reply

Inspiring
August 1, 2013

I found my own answer!!!! apparently even though I am using AIR 3.6, I still needed to include a compiler argument...

-swf-version=18

without this, not only does the landscape not behave correctly, sometimes calling the "stage.setAspectRatio(StageAspectRatio.ANY)" will throw an error.

WHEW

Mark.fromOP
Inspiring
August 3, 2013

Was this issue on the Galaxy Tab? They are notorious for screwing up landscape vs portrait.