iPhone 5 launch Image problem with landscape only universal app.

I am in the process of turning an iPad only app into a universal app.

Currently I only have an iPhone 5 running iOS 9.3.1 to test on. I am using Corona Build 2016.2830.

This app is locked into both landscape left and right only, and launches as UIInterfaceOrientationLandscapeRight.

When I launch my app on the iPhone 5, the image which is in portrait mode gets rotated and squished to fit landscape orientation. I water-marked all of my image assets so that I could tell which image is chosen. It is Default-568h@2x.png. 

Does anyone else have this problem ?or know of a solution?

Can you post your build.settings?

settings = { window = {         resizable = true, titleText = {             default = "myWindowsApp", }, enableMaximizeButton = true, enableMinimizeButton = true, enableCloseButton = true, minViewHeight =  768, minViewWidth = 1024, defaultViewHeight = 768,  defaultViewWidth = 1024,     }, plugins =     {         -- key is the name passed to Lua's 'require()'         ["plugin.bit"] =         {             -- required             publisherId = "com.coronalabs",         },     },       iphone = { plist = { MinimumOsVersion="6.0", UIRequiredDeviceCapabilities={ "wifi", "armv7", }, UILaunchImages = {                 {  --iPhone 4                     ["UILaunchImageMinimumOSVersion"] = "7.0",                     ["UILaunchImageName"] = "Default",                     ["UILaunchImageOrientation"] = "Portrait",                     ["UILaunchImageSize"] = "{320, 480}"                 },                 {  --iPhone 4                     ["UILaunchImageMinimumOSVersion"] = "7.0",                     ["UILaunchImageName"] = "Default",                     ["UILaunchImageOrientation"] = "Landscape",                     ["UILaunchImageSize"] = "{320, 480}"                 },                 {  --iPhone 5                     ["UILaunchImageMinimumOSVersion"] = "7.0",                     ["UILaunchImageName"] = "Default-568h",                     ["UILaunchImageOrientation"] = "Portrait",                     ["UILaunchImageSize"] = "{320, 568}"                 },                 {  --iPhone 5                     ["UILaunchImageMinimumOSVersion"] = "7.0",                     ["UILaunchImageName"] = "Default-568h",                     ["UILaunchImageOrientation"] = "Landscape",                     ["UILaunchImageSize"] = "{320, 568}"                 },                 {  --iPad landscape                     ["UILaunchImageMinimumOSVersion"] = "7.0",                     ["UILaunchImageName"] = "Default-Landscape",                     ["UILaunchImageOrientation"] = "Landscape",                     ["UILaunchImageSize"] = "{768, 1024}"                 },                 {  --iPhone 6                     ["UILaunchImageMinimumOSVersion"] = "8.0",                     ["UILaunchImageName"] = "Default-667h",                     ["UILaunchImageOrientation"] = "Portrait",                     ["UILaunchImageSize"] = "{375, 667}"                 },                 {  --iPhone 6                     ["UILaunchImageMinimumOSVersion"] = "8.0",                     ["UILaunchImageName"] = "Default-667h",                     ["UILaunchImageOrientation"] = "Landscape",                     ["UILaunchImageSize"] = "{375, 667}"                 },                 { -- iPhone 6 Plus landscape                     ["UILaunchImageMinimumOSVersion"] = "8.0",                     ["UILaunchImageName"] = "Default-Landscape-736h",                     ["UILaunchImageOrientation"] = "Landscape",                     ["UILaunchImageSize"] = "{414, 736}"                 }             }, UIInterfaceOrientation = "UIInterfaceOrientationLandscapeRight", UISupportedInterfaceOrientations = { "UIInterfaceOrientationLandscapeRight", "UIInterfaceOrientationLandscapeLeft", }, UIFileSharingEnabled = true, UIPrerenderedIcon = false, UIStatusBarHidden = false, UIApplicationExitsOnSuspend = true, CFBundleIconFile = "Icon-72.png", CFBundleIconFiles = {  "Icon.png",                 "Icon@2x.png",                 "Icon-60.png",                 "Icon-60@2x.png",                 "Icon-60@3x.png",                 "Icon-72.png",                 "Icon-72@2x.png",                 "Icon-76.png",                 "Icon-76@2x.png",                 "Icon-167.png",                 "Icon-Small-40.png",                 "Icon-Small-40@2x.png",                 "Icon-Small-40@3x.png",                 "Icon-Small-50.png",                 "Icon-Small-50@2x.png",                 "Icon-Small.png",                 "Icon-Small@2x.png",                 "Icon-Small@3x.png" }, UIAppFonts = { "GillSans-Book.ttf",  },                  CFBundleURLTypes =             {                 {                   CFBundleURLSchemes =                   {                        "myApp", }                                               } } }, }, android =     {         usesPermissions =         {             "android.permission.INTERNET",         },     }, orientation = { default = "landscapeRight", supported = { "landscapeRight","landscapeLeft", }, }, }

I think I might know what is going on. I was able to resolve the issue partially by removing the landscape specification for iPhone 5. 

Now the image loads correctly, however it appears upside down in landscapeLeft but not in landscapeRight.

  {  --iPhone 5                     ["UILaunchImageMinimumOSVersion"] = "7.0",                     ["UILaunchImageName"] = "Default-568h",                     ["UILaunchImageOrientation"] = "Landscape",                     ["UILaunchImageSize"] = "{320, 568}"                 },

All iPhones prior to 6.0+ only supported portrait mode, however, there was a bug in iOS 8.0 that made it so you needed to 

specify landscape mode for all iPhones as is done above. I don’t think that is true with iOS 9.3.1

I haven’t determined if the behavior now allows specifying a landscape image for iPhone (4-6) or if I will need to remove the 

landscape from iPhone (4-6) entries and just live with the undesirable behavior of an upside down image when users launch in with phone in landscapeLeft rotation. 

I am going to do more testing and report back my findings

I can confirm this and add a little more to it.

All iOS Phones expect for the iPhone 6 plus (the big phone) only use portrait oriented images. The 6 plus will use both landscape and portrait launch images.

There was a bug that required specifying landscape orientations in our build.settings in iOS 8, but it’s been fixed.

If your phone app is landscape only, produce a portrait launcher image but have the contents rotated so that when the phone is held in landscape mode, it looks right.

Rob

Thanks for the confirmation Rob,

I tested the launch images and they are working now.

I still have the issues with the difference in behavior between iPhone and iPad

I am not sure what rotating the contents has to do with the launch screen? 

Basically, when I launch from a landscape left physical orientation, the launch image appears right side up on iPad but upside down on the iPhone.

Another peculiar behavior, after the launch screen behavior above occurs, the app graphics seems to be pre-rotated (IE: rotated without any animation) on the iPad, however on the iPhone I actually see the screen get rotated following the Launch screen. Again that behavior only happens  when I launch from a landscape left physical orientation.

I am assuming that since rotation happens automatically, there isn’t anything I could do about it? other than maybe turn off all but one orientation in my plIst and rotate the screen myself on orientation change events.

In which case that seems like overkill for now.

Maybe this will help with understanding what I meant by rotating the images. In this graphic, the physical image is portrait oriented which is needed for the iPhones. But the contents of the image are rotated to be landscape. When the phone loads the image it will fit the screen correctly and if the user is holding the phone sideways, the image will appear to be landscape.

Rob,

I get it now, but that is what I am already doing.

There are limitations to that approach that I was attempting to describe. See the following image to get a better idea of what I am experiencing now.

IMAGE SHARED HERE

The launch image is handled solely by iOS. I suspect he difference between phones and iPads is because you can specify landscape versions and on the iPhones you can only specify the portrait version.

Rob

Rob,

Thank you for sharing your thoughts on this matter. I expected that that was the case.

Can you post your build.settings?

settings = { window = {         resizable = true, titleText = {             default = "myWindowsApp", }, enableMaximizeButton = true, enableMinimizeButton = true, enableCloseButton = true, minViewHeight =  768, minViewWidth = 1024, defaultViewHeight = 768,  defaultViewWidth = 1024,     }, plugins =     {         -- key is the name passed to Lua's 'require()'         ["plugin.bit"] =         {             -- required             publisherId = "com.coronalabs",         },     },       iphone = { plist = { MinimumOsVersion="6.0", UIRequiredDeviceCapabilities={ "wifi", "armv7", }, UILaunchImages = {                 {  --iPhone 4                     ["UILaunchImageMinimumOSVersion"] = "7.0",                     ["UILaunchImageName"] = "Default",                     ["UILaunchImageOrientation"] = "Portrait",                     ["UILaunchImageSize"] = "{320, 480}"                 },                 {  --iPhone 4                     ["UILaunchImageMinimumOSVersion"] = "7.0",                     ["UILaunchImageName"] = "Default",                     ["UILaunchImageOrientation"] = "Landscape",                     ["UILaunchImageSize"] = "{320, 480}"                 },                 {  --iPhone 5                     ["UILaunchImageMinimumOSVersion"] = "7.0",                     ["UILaunchImageName"] = "Default-568h",                     ["UILaunchImageOrientation"] = "Portrait",                     ["UILaunchImageSize"] = "{320, 568}"                 },                 {  --iPhone 5                     ["UILaunchImageMinimumOSVersion"] = "7.0",                     ["UILaunchImageName"] = "Default-568h",                     ["UILaunchImageOrientation"] = "Landscape",                     ["UILaunchImageSize"] = "{320, 568}"                 },                 {  --iPad landscape                     ["UILaunchImageMinimumOSVersion"] = "7.0",                     ["UILaunchImageName"] = "Default-Landscape",                     ["UILaunchImageOrientation"] = "Landscape",                     ["UILaunchImageSize"] = "{768, 1024}"                 },                 {  --iPhone 6                     ["UILaunchImageMinimumOSVersion"] = "8.0",                     ["UILaunchImageName"] = "Default-667h",                     ["UILaunchImageOrientation"] = "Portrait",                     ["UILaunchImageSize"] = "{375, 667}"                 },                 {  --iPhone 6                     ["UILaunchImageMinimumOSVersion"] = "8.0",                     ["UILaunchImageName"] = "Default-667h",                     ["UILaunchImageOrientation"] = "Landscape",                     ["UILaunchImageSize"] = "{375, 667}"                 },                 { -- iPhone 6 Plus landscape                     ["UILaunchImageMinimumOSVersion"] = "8.0",                     ["UILaunchImageName"] = "Default-Landscape-736h",                     ["UILaunchImageOrientation"] = "Landscape",                     ["UILaunchImageSize"] = "{414, 736}"                 }             }, UIInterfaceOrientation = "UIInterfaceOrientationLandscapeRight", UISupportedInterfaceOrientations = { "UIInterfaceOrientationLandscapeRight", "UIInterfaceOrientationLandscapeLeft", }, UIFileSharingEnabled = true, UIPrerenderedIcon = false, UIStatusBarHidden = false, UIApplicationExitsOnSuspend = true, CFBundleIconFile = "Icon-72.png", CFBundleIconFiles = {  "Icon.png",                 "Icon@2x.png",                 "Icon-60.png",                 "Icon-60@2x.png",                 "Icon-60@3x.png",                 "Icon-72.png",                 "Icon-72@2x.png",                 "Icon-76.png",                 "Icon-76@2x.png",                 "Icon-167.png",                 "Icon-Small-40.png",                 "Icon-Small-40@2x.png",                 "Icon-Small-40@3x.png",                 "Icon-Small-50.png",                 "Icon-Small-50@2x.png",                 "Icon-Small.png",                 "Icon-Small@2x.png",                 "Icon-Small@3x.png" }, UIAppFonts = { "GillSans-Book.ttf",  },                  CFBundleURLTypes =             {                 {                   CFBundleURLSchemes =                   {                        "myApp", }                                               } } }, }, android =     {         usesPermissions =         {             "android.permission.INTERNET",         },     }, orientation = { default = "landscapeRight", supported = { "landscapeRight","landscapeLeft", }, }, }

I think I might know what is going on. I was able to resolve the issue partially by removing the landscape specification for iPhone 5. 

Now the image loads correctly, however it appears upside down in landscapeLeft but not in landscapeRight.

  {  --iPhone 5                     ["UILaunchImageMinimumOSVersion"] = "7.0",                     ["UILaunchImageName"] = "Default-568h",                     ["UILaunchImageOrientation"] = "Landscape",                     ["UILaunchImageSize"] = "{320, 568}"                 },

All iPhones prior to 6.0+ only supported portrait mode, however, there was a bug in iOS 8.0 that made it so you needed to 

specify landscape mode for all iPhones as is done above. I don’t think that is true with iOS 9.3.1

I haven’t determined if the behavior now allows specifying a landscape image for iPhone (4-6) or if I will need to remove the 

landscape from iPhone (4-6) entries and just live with the undesirable behavior of an upside down image when users launch in with phone in landscapeLeft rotation. 

I am going to do more testing and report back my findings

I can confirm this and add a little more to it.

All iOS Phones expect for the iPhone 6 plus (the big phone) only use portrait oriented images. The 6 plus will use both landscape and portrait launch images.

There was a bug that required specifying landscape orientations in our build.settings in iOS 8, but it’s been fixed.

If your phone app is landscape only, produce a portrait launcher image but have the contents rotated so that when the phone is held in landscape mode, it looks right.

Rob

Thanks for the confirmation Rob,

I tested the launch images and they are working now.

I still have the issues with the difference in behavior between iPhone and iPad

I am not sure what rotating the contents has to do with the launch screen? 

Basically, when I launch from a landscape left physical orientation, the launch image appears right side up on iPad but upside down on the iPhone.

Another peculiar behavior, after the launch screen behavior above occurs, the app graphics seems to be pre-rotated (IE: rotated without any animation) on the iPad, however on the iPhone I actually see the screen get rotated following the Launch screen. Again that behavior only happens  when I launch from a landscape left physical orientation.

I am assuming that since rotation happens automatically, there isn’t anything I could do about it? other than maybe turn off all but one orientation in my plIst and rotate the screen myself on orientation change events.

In which case that seems like overkill for now.

Maybe this will help with understanding what I meant by rotating the images. In this graphic, the physical image is portrait oriented which is needed for the iPhones. But the contents of the image are rotated to be landscape. When the phone loads the image it will fit the screen correctly and if the user is holding the phone sideways, the image will appear to be landscape.

Rob,

I get it now, but that is what I am already doing.

There are limitations to that approach that I was attempting to describe. See the following image to get a better idea of what I am experiencing now.

IMAGE SHARED HERE

The launch image is handled solely by iOS. I suspect he difference between phones and iPads is because you can specify landscape versions and on the iPhones you can only specify the portrait version.

Rob

Rob,

Thank you for sharing your thoughts on this matter. I expected that that was the case.