Screen aspect ratio different in simulator vs Xcode Sim or Device

Hi all,

I just upgraded xcode and corona to the latest public releases (v9 and 2017-3135) and now my app is showing a wide bar at the top and bottom of the screen when viewed as an iPhone 6 (sim or device). In Corona, it looks fine but not in xcode or the phone itself. Has anyone else noticed this? I have several apps that have used the same code in the config file for a  number of years with no issues:

   content = {

      width = aspectRatio > 1.5 and 400 or math.ceil( 600 / aspectRatio ),

      height = aspectRatio < 1.5 and 600 or math.ceil( 400 * aspectRatio ),

      scale = “letterBox”,

      fps = 60,

      imageSuffix = {

         ["@2x"] = 1.5,

         ["@4x"] = 3.0,

      },

   },

Forgot the line where aspectRatio is defined:

local aspectRatio = display.pixelHeight / display.pixelWidth

Hi @jeff15,

Can you please build and install the “Timer” sample project and see if the same thing happens? It’s located in your Corona application folder here:

SampleCode > GettingStarted > Timer

Thanks,

Brent

Hi Brent,

Just tried it and it looks fine in both Corona’s and Xcode’s simulators. Hmmm…

Are you using the modern “LaunchImage” approach in your older apps? If not, that might be one issue in this scenario…

https://docs.coronalabs.com/guide/distribution/buildSettings/index.html#ios-launch-screen

Brent

I hadn’t implemented the launch image yet (have in a previous app but not on this update yet). But could this impact the screens within the app (not just the launch screen)?

Depending on whether you have the full “array” setup as outlined in the “Static Method” section of the guide, it’s not unheard of that it could affect the app screens.

Does your other app with the modern method get affected in the same way as the issue being described in this post?

Brent

Thanks Brent! That was indeed the problem. Even just adding UILaunchStoryboardName = “LaunchScreen”, to my plist in the build settings (before actually creating a launch screen) solved the problem. I don’t get why but am happy it works! :slight_smile:

Cheers,
Jeff

Forgot the line where aspectRatio is defined:

local aspectRatio = display.pixelHeight / display.pixelWidth

Hi @jeff15,

Can you please build and install the “Timer” sample project and see if the same thing happens? It’s located in your Corona application folder here:

SampleCode > GettingStarted > Timer

Thanks,

Brent

Hi Brent,

Just tried it and it looks fine in both Corona’s and Xcode’s simulators. Hmmm…

Are you using the modern “LaunchImage” approach in your older apps? If not, that might be one issue in this scenario…

https://docs.coronalabs.com/guide/distribution/buildSettings/index.html#ios-launch-screen

Brent

I hadn’t implemented the launch image yet (have in a previous app but not on this update yet). But could this impact the screens within the app (not just the launch screen)?

Depending on whether you have the full “array” setup as outlined in the “Static Method” section of the guide, it’s not unheard of that it could affect the app screens.

Does your other app with the modern method get affected in the same way as the issue being described in this post?

Brent

Thanks Brent! That was indeed the problem. Even just adding UILaunchStoryboardName = “LaunchScreen”, to my plist in the build settings (before actually creating a launch screen) solved the problem. I don’t get why but am happy it works! :slight_smile:

Cheers,
Jeff