Copy link to clipboard
Copied
Hi,
I am new to Flash builder (flex) development for ios, when I created my first "View-Based" application and ran it in the iOs simulator iPhone 4" Retina, it would not fit completely, I can see some empty space at the top and the bottom.....
Any help guys!!
Thanks,
You need to add a startup splash screen image that is the size of the iPhone 5 screen. You may have to google for more detail, I don't have it handy. But this is how the iOS device knows what the useable screen size is. Then your app will fill the screen properly.
::Jason
Copy link to clipboard
Copied
You need to add a startup splash screen image that is the size of the iPhone 5 screen. You may have to google for more detail, I don't have it handy. But this is how the iOS device knows what the useable screen size is. Then your app will fill the screen properly.
::Jason
Copy link to clipboard
Copied
Here's some rough code that might be of use, mainly for Apple units as the others vary so much.
I use the dpi to determine which device it's running on and force the full screen (fs) values from that.
It's not pretty but it works.
On a side note, I use the divider/multiplier values for virtual measures.
Ie, if I have a button that is 60x60 pixels on a computer screen (72 to 96 dpi, I use 92) I can then divide/multiply the button size so that it is the same physical size no matter the device dpi (so the button isn't too small for my finger on mobile devices).
S.device.dpi = flash.system.Capabilities.screenDPI
S.device.divider = 92 / S.device.dpi
S.device.multiplier = S.device.dpi / 92
if(S.device.dpi == 264){
//iPad 3+4
S.device.width.fs = 1536;
S.device.height.fs = 2048;
} else if(S.device.dpi == 132){
//iPad 1+2
S.device.width.fs = 768;
S.device.height.fs = 1024;
} else if(S.device.dpi == 326){
if(this.stage.stageHeight/this.stage.stageWidth > 1.6){
//iPhone 5
S.device.width.fs = 640;
S.device.height.fs = 1136;
} else {
//iPhone 4
S.device.width.fs = 640;
S.device.height.fs = 960;
}
} else {
//Others, ie Android etc
S.device.width.fs = Math.min(this.stage.stageWidth, Screen.mainScreen.visibleBounds.width);
S.device.height.fs = Math.min(this.stage.stageHeight, Screen.mainScreen.visibleBounds.height);
}
Hope this helps.