Skip to main content
dolldivine
Inspiring
November 8, 2018
Question

Can't get proper pixel size of iOS devices

  • November 8, 2018
  • 3 replies
  • 4821 views

I'm testing an iOS app made in Animate CC on an iPhone 7 Plus.

Allegedly the (portrait) resolution is 1080x1920px

(according to this: Displays )

Everything works great when I test it inside Animate, no matter what I set the size to.

But testing on the phone, using stage.fullScreenHeight (/Width), it thinks the phone is 640x960.  At least that's what it echos back when I ask in the app while testing.

I found other threads that suggested using Capabilities.screenResolutionX (/Y)

That yielded the exact same result.. 640x960.

Another thread said the launch images dictate the resolution, so I created all the required (portrait) launch images according to this: Launch Images on iOS with Adobe AIR  I appended all the png images in the "AIR for iOS" Settings.

Interestingly, according to this, the 7 Plus is 1242x2208px

Why are two pages reporting different sizes?  At least it's the same ratio.. Well, the code is meant to accommodate sizing on all devices so it shouldn't really matter but anyway...

The point is, sizing works beautiful testing within Animate.  But I can't get it to work on devices, mainly the iPhone 7+ but I've also tested the iPhone X and two sizes of iPad and they all look pretty bad.  Why isn't it picking up the launch image(s)?  Why does it think the phone is 640x960???

This topic has been closed for replies.

3 replies

Lars Laborious
Legend
November 8, 2018

Since you're working in Animate CC, be sure to set resolution to high and check "Full screen" in the AIR for iOS Settings, if you haven't already.

Colin Holgate
Inspiring
November 8, 2018

Full screen might only gain a little bit of difference in the height value.

If you are using a scalemode of noScale, use the resize event to get your first reading of the stage size.

Colin Holgate
Inspiring
November 8, 2018

The one that determine whether the phone is old iPhone ratio or 9:16 ratio, is  Default-568h@2x.png. It might also be named Default-568h@2x~iphone.png, I tend to include both of those. Once that is in place an iPhone 5 will fill its 640x1136 instead of 640x960, and all other 9:16 or greater phones will show at least that much. For iPhone X you need other splash screens for it to fill the full height of those phones.

So, although you're testing iPhone 7 Plus, make sure to include the iPhone 5 Default-568h@2x~iphone.png image.

dolldivine
Inspiring
November 8, 2018

Thanks Colin.  I do believe I have that...

Btw, I got to re-test on my ipads now with the size trace statements, and I believe they are actually tracing correctly, both saying 1536x2048, and they both fill the screen and look crisp.  I don't see the splash screen pop up though, so I'm not sure if it's registering (is it just too fast to see when testing?)

I'm seeing that the first two launch images are actually 640x960.. the ones for the iPhone 4.  Maybe I should take those out?  Are they overriding the others?

dolldivine
Inspiring
November 8, 2018

Is the order in which they are added to the "AIR for iOS" settings important?

dolldivine
Inspiring
November 8, 2018

I understand the newer models do some kind of 2x, 3x scaling magic, but that still doesn't explain why the app thinks the phone has a ratio of 1.5, because it's more like 1.78...  very strange.  Where is it getting 640x960 from?  It's not what the stage is set to or anything..