Skip to main content
Known Participant
September 19, 2013
Question

Different Orientations for iPhone/iPad

  • September 19, 2013
  • 1 reply
  • 690 views

We're working on a universal iOS app and want to be able to run in portrait mode for iPhone and landscape mode for iPad.


Right now we're setting the aspect ratio in code on the first frame, but this causes the screen to display a rotating animation as the application changes orientation, which looks bad. Is there a better way to do this?

This topic has been closed for replies.

1 reply

Adobe Employee
September 20, 2013

Are you seen this while debugging? I request to check it once without debugging and see if the problem is still reproducible.

Regards,

Nimit

Known Participant
September 21, 2013

We're seeing this issue on the actual device (iPhone 4 running iOS 6) on all deployment types both with and without debugging. We're compiling with Flash Professonal CC to Air 3.9.1.1080. We have the aspect ratio set to landscape, full screen is on and auto orientation is off.

After some more experimentation, we are only able to get the app to load without the rotating animation under very specific conditions:

  • Must have exported a large asset (~100k) on the first frame, such as an image
  • Cannot have any objects on the stage at load time
  • Immediatly change the stage aspect ratio setting to portriat in the main class's construtor and turn back on auto orientation
  • Wait 10 frames before adding any objects to the stage

If any of those conditions are not met, the rotation animation returns. This appears to "fix" the problem on first load. If you kill the application and try to re-open it, the rotating animation will return sometimes.

This seems really buggy to me and must have something to do with Air's initialization code somehow. I don't like the 10 frame lag before displaying anything to the screen plus I really don't feel comfortable shipping anything relaying on this hack. Any ideas?