Screen size problem when testing on iPhone 5

Hi everbody,

I installed my game on iPhone 5 device(1136x640/568x320), and the bounds of the screen are shown in iPhone 4 “style”(960x640/480x320), rest of the screen is blank (black). When building In Corona simulator everything works fine. Anyone knows why ?
 

You are required to have a file in your folder with your main.lua named:

Default-568h@2x.png

It must exactly match that name (case sensitive).  It must be exactly 640px wide and 1136px high.  Without this, the OS will think your an iPhone 4.

Rob

I am facing a similar problem. However I have Default-568h@2x.png in my root folder. My app supports only landscape orientation. 

Here are the files I have:

Default.png    320 × 480

Default@2x.png 640x960

Default-568h@2x.png 640 × 1136

Default-Landscape.png 1024 x 768

Default-Landscape@2x.png 2048 x 1536

Default-Landscape-667h@2x.png 1334 X 750

Default-Landscape-736h@2x.png 2208 x 1242

Default-Landscape-568h@2x.png 1136x640

 

The following is from build.settings file

UILaunchImages = { { -- iPhone 4 LandscapeLeft ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{320,480}" }, { -- iPhone 4 LandscapeRight ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{320,480}" }, { -- iPhone 5 LandscapeLeft ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-568h", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{320,568}" }, { -- iPhone 5 LandscapeRight ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-568h", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{320,568}" }, { -- iPad LandscapeLeft ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-Landscape", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{768,1024}" }, { -- iPad LandscapeRight ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-Landscape", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{768,1024}" }, { -- iPhone 6 LandscapeLeft ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-667h", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{375,667}" }, { -- iPhone 6 LandscapeRight ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-667h", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{375,667}" }, { -- iPhone 6 Plus LandscapeLeft ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-Landscape-736h", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{414,736}" }, { -- iPhone 6 Plus LandscapeRight ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-Landscape-736h", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{414,736}" } }

Am I missing something here?

Actually yes…  All lines like this:

[“UILaunchImageSize”] = “{414,736}”

need to be like this:

[“UILaunchImageSize”] = “{414, 736}”

for some reason the space after the comma is important.

Rob

Hi,

I have tested on both device and simulator. The problem still remains. I still see the black bars on either side. The following is my config file(ultimate config file)

if string.sub(system.getInfo("model"),1,4) == "iPad" then application = { content = { width = 360, height = 480, scale = "letterBox", xAlign = "center", yAlign = "center", fps = 60, imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, }, }, notification = { iphone = { types = { "badge", "sound", "alert" } } } } elseif string.sub(system.getInfo("model"),1,2) == "iP" and display.pixelHeight \> 960 then application = { content = { width = 320, height = 568, scale = "letterBox", xAlign = "center", yAlign = "center", imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, }, }, notification = { iphone = { types = { "badge", "sound", "alert" } } } } elseif string.sub(system.getInfo("model"),1,2) == "iP" then application = { content = { width = 320, height = 480, scale = "letterBox", xAlign = "center", yAlign = "center", imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, }, }, notification = { iphone = { types = { "badge", "sound", "alert" } } } } elseif display.pixelHeight / display.pixelWidth \> 1.72 then application = { content = { width = 320, height = 570, scale = "letterBox", xAlign = "center", yAlign = "center", imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, }, }, } else application = { content = { width = 320, height = 512, scale = "letterBox", xAlign = "center", yAlign = "center", imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, }, }, notification = { iphone = { types = { "badge", "sound", "alert" } } } } end

In the project build settings documentation page, under launch image section, the following is stated.

If your app is portrait orientation or landscape orientation only, include just the portrait or landscape versions of these files respectively.

This is a little ambiguous, as later

For backward compatibility with iOS 6, you  must  include the Default-568h@2x.png file. This activates the iPhone 5 tall mode.

Now my app is Landscape only, so should I include Default-568h@2x.png for tall mode activation or leave it out because it is listed under portrait mode?

Finally, after a lot of trail and error, I have managed to identify the issue. In the build.settings file I had previously deleted all portrait related launch image configurations(out of my infinite wisdom :angry: ). It worked after I added them back. 

You are required to have a file in your folder with your main.lua named:

Default-568h@2x.png

It must exactly match that name (case sensitive).  It must be exactly 640px wide and 1136px high.  Without this, the OS will think your an iPhone 4.

Rob

I am facing a similar problem. However I have Default-568h@2x.png in my root folder. My app supports only landscape orientation. 

Here are the files I have:

Default.png    320 × 480

Default@2x.png 640x960

Default-568h@2x.png 640 × 1136

Default-Landscape.png 1024 x 768

Default-Landscape@2x.png 2048 x 1536

Default-Landscape-667h@2x.png 1334 X 750

Default-Landscape-736h@2x.png 2208 x 1242

Default-Landscape-568h@2x.png 1136x640

 

The following is from build.settings file

UILaunchImages = { { -- iPhone 4 LandscapeLeft ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{320,480}" }, { -- iPhone 4 LandscapeRight ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{320,480}" }, { -- iPhone 5 LandscapeLeft ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-568h", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{320,568}" }, { -- iPhone 5 LandscapeRight ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-568h", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{320,568}" }, { -- iPad LandscapeLeft ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-Landscape", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{768,1024}" }, { -- iPad LandscapeRight ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-Landscape", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{768,1024}" }, { -- iPhone 6 LandscapeLeft ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-667h", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{375,667}" }, { -- iPhone 6 LandscapeRight ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-667h", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{375,667}" }, { -- iPhone 6 Plus LandscapeLeft ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-Landscape-736h", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{414,736}" }, { -- iPhone 6 Plus LandscapeRight ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-Landscape-736h", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{414,736}" } }

Am I missing something here?

Actually yes…  All lines like this:

[“UILaunchImageSize”] = “{414,736}”

need to be like this:

[“UILaunchImageSize”] = “{414, 736}”

for some reason the space after the comma is important.

Rob

Hi,

I have tested on both device and simulator. The problem still remains. I still see the black bars on either side. The following is my config file(ultimate config file)

if string.sub(system.getInfo("model"),1,4) == "iPad" then application = { content = { width = 360, height = 480, scale = "letterBox", xAlign = "center", yAlign = "center", fps = 60, imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, }, }, notification = { iphone = { types = { "badge", "sound", "alert" } } } } elseif string.sub(system.getInfo("model"),1,2) == "iP" and display.pixelHeight \> 960 then application = { content = { width = 320, height = 568, scale = "letterBox", xAlign = "center", yAlign = "center", imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, }, }, notification = { iphone = { types = { "badge", "sound", "alert" } } } } elseif string.sub(system.getInfo("model"),1,2) == "iP" then application = { content = { width = 320, height = 480, scale = "letterBox", xAlign = "center", yAlign = "center", imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, }, }, notification = { iphone = { types = { "badge", "sound", "alert" } } } } elseif display.pixelHeight / display.pixelWidth \> 1.72 then application = { content = { width = 320, height = 570, scale = "letterBox", xAlign = "center", yAlign = "center", imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, }, }, } else application = { content = { width = 320, height = 512, scale = "letterBox", xAlign = "center", yAlign = "center", imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, }, }, notification = { iphone = { types = { "badge", "sound", "alert" } } } } end

In the project build settings documentation page, under launch image section, the following is stated.

If your app is portrait orientation or landscape orientation only, include just the portrait or landscape versions of these files respectively.

This is a little ambiguous, as later

For backward compatibility with iOS 6, you  must  include the Default-568h@2x.png file. This activates the iPhone 5 tall mode.

Now my app is Landscape only, so should I include Default-568h@2x.png for tall mode activation or leave it out because it is listed under portrait mode?

Finally, after a lot of trail and error, I have managed to identify the issue. In the build.settings file I had previously deleted all portrait related launch image configurations(out of my infinite wisdom :angry: ). It worked after I added them back.