Skip to main content
Inspiring
November 25, 2013
Answered

Aspect ratio: Auto vs. Auto orientation

  • November 25, 2013
  • 2 replies
  • 3036 views

What is the difference between the settings "Aspect ratio = auto" and "Auto orientation = true"?

-Aaron

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

The aspect ratio setting of portrait, landscape, or auto, controls what orientation the app opens up in. Most times you would choose portrait or landscape, but in doing so you’re saying that the app only uses that ratio. If you have an app that is both portrait and landscape, then auto might make sense. You would also want to include all of the possible splash screens, not just the portrait or landscape ones.

Auto orient controls whether the app will rotate around when the user turns the device 90 or 180 degrees. For iOS apps you would most likely want that to be on, because it’s a requirement for the iTunes store. But, as an alternative you can have it set to be off, then change that at runtime to be on at the right times. One example use case would be if part of the game play involves using the accelerometer, you wouldn’t want the screen to rotate on the user while playing that part of the game.

2 replies

Colin Holgate
Colin HolgateCorrect answer
Inspiring
November 26, 2013

The aspect ratio setting of portrait, landscape, or auto, controls what orientation the app opens up in. Most times you would choose portrait or landscape, but in doing so you’re saying that the app only uses that ratio. If you have an app that is both portrait and landscape, then auto might make sense. You would also want to include all of the possible splash screens, not just the portrait or landscape ones.

Auto orient controls whether the app will rotate around when the user turns the device 90 or 180 degrees. For iOS apps you would most likely want that to be on, because it’s a requirement for the iTunes store. But, as an alternative you can have it set to be off, then change that at runtime to be on at the right times. One example use case would be if part of the game play involves using the accelerometer, you wouldn’t want the screen to rotate on the user while playing that part of the game.

Inspiring
November 26, 2013

Thanks guys, that mostly clears it up. If I understand correctly, the aspectRatio is mainly for how the app initially loads, while the autoOrientation flag indicates whether or not the orientation can change based on device rotation. What threw me off is that when I set autoOrientation=true, it did not automatically re-orient the app stage when I rotated my Nexus 4 -- it only did that when I also set the aspectRatio to auto (any.) I'm still not really clear why autoOrientation didn't override the aspectRatio setting after the app loaded; maybe this has more meaning on iOS than Android?

-Aaron

Colin Holgate
Inspiring
November 26, 2013

The aspect ratio setting isn’t just the initial orientation, it’s the only orientation. You should be able to set portrait and get normal and upside-down portrait to work, and landscape would give you either of the two landscapes. It will only rotate to portrait if you’re set to Any, or if you have auto orient turned off and take care of everything with your own code.

Participant
November 26, 2013

By aspect ratio=auto, you must have meant the default aspect ratio setting or aspect ratio-"any". This allows app to launch as per the device orientation. For example:- if you are holding the device in landscape, app will launc in landscape. Similarly if you are holding it in portrait, app will launch in portrait! But if the device orientation changes when the app is in foreground, it will auto rotate only when auto orients is set to true. Otherwise the app will remain in the orientation in which it was opened.

I hope this clears your query. More details about default aspect ratio can be found at the following link

https://blogs.adobe.com/airodynamics/2012/05/22/stage-aspectratio-enhancements/#more-75