Question

I develop an app for phone and tablet devices. When the device is a phone the app will be displayed only in portrait. When the device is a tablet the app will be displayed only in landscape.

This is no problem and works fine. In the app XML the default aspectRation is portrait. So i check in runtime if the device is a tablet and change the aspectRation to landscape. _nativeStage.autoOrients = true; _nativeStage.setAspectRatio(StageAspectRatio.LANDSCAPE); Everything is working.

There is just one problem: When you rotate the iPad for example to upside down(Hardware menu button is now on the left side of the device ;) ) and than start the app, the device rotates default to rotatedRight. So the application stands on the head. Also the ios action bar is on the bottom.

I didnt find out where i get the current orientation on startup. When i check stage.deviceOrientation or stage.orientaion i get just "default"or "undefined" in both orientations. (normal or upside down)

Maby someone knows a solution to get the correct rotation from the device on startup. than i can check and can make stage.setOrientation(StageOrientation.ROTATED_RIGHT); or stage.setOrientation(StageOrientation.ROTATED_LEFT);

Please help me :(

Was it helpful?

Solution

I found the solution ... :D Just set the aspectRatio tag in your app.xml file to "any" and it works ... maby someone helps

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top