Copy link to clipboard
Copied
Hi,
I am creating an app with AS3 for Android and also for iOS.
Due to the different smartphone sizes it is necessary to scale the apps to the appropriate screens. Developing for Android that seems to work OK.
The code I use for this on Android however does not work on iOS.
On iOS it seems that I can only scale the app to the width of the screen. The height of the app then scales proportionally to the width of the app. The rest of the length of the app is now outside the screen boundaries.
How can I scale to the app also to the different iOS screens?
Any help is greatly appreciated.
Code:
-------------
stop();
import flash.display.Stage;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
//Works on Android not on iOS:
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
//Works on iOS however part height of app may be outside screen boundaries
stage.scaleMode = StageScaleMode.NO_BORDER;
//rest of code like this:
header_mc.x = stage.stageWidth / 2;
header_mc.y = 0;
header_mc.width = stage.stageWidth;
header_mc.height = stage.stageWidth / 4;
//etc.....
Have something to add?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now