3

As LaunchScreen I want to have an exact image of the start page that appears right after the launch. Therefore, I made screenshots of all resolutions of the start page, both portrait and landscape. Then I removed all fonts because I generate two variants of the app in different languages and the texts (e.g. in the buttons) are different. The launch screens should fit both variants. In Images.xcassets I added LaunchImage and assigned all positions with the correct resolutions (for both, iPhone and iPad). LaunchScreen.storyboard has an ImageView in the ViewController with the image name LaunchImage.

Result:

1 All launch images displayed are scaled even though the correct resolutions are available.

  1. Only the portrait images are used, also for landscape, and therefore scaled and distorted.

  2. on iPads only iPhone images are displayed, portrait version also in landscape, scaled accordingly.

  3. On some devices (e.g. iPhone X), only a white or black screen is displayed at launch (portrait and landscape).

Under no circumstances will the correct launch screen be displayed. On the image you see all relevant areas and the list of all used launch images.

What did I do wrong or miss?

enter image description here Supplement: I just followed another tip and deactivated "Clears Graphic Context" in UIImageView and changed the display to "Aspect Fit". Result: The portrait launch image is still used in the iPad, but is no longer scaled and is now centered. So the most important question now is why an iPhone portrait launch image is used for iPad in both directions.

thpitsch
  • 2,016
  • 2
  • 21
  • 27
  • Why don't you just copy the first scene from your main storyboard to the launch storyboard? You will need to remove the custom class. The whole point of launch storyboards is not having to worry about different device sizes. – Paulw11 Jun 18 '18 at 08:48
  • This is an old app without a main storyboard. And the xip is only a part of the first screen. Other parts are added in the program. So my screenshots are the best way to show what will displayed next. And Apple recommends this launch images in all resolutions in xcassets. Somehow this has to work. – thpitsch Jun 18 '18 at 11:51
  • I don't think Apple *recommends* launch screenshots at all. If you do use launch screen shots then you do need to add all of the resolutions. How are you testing? Debug builds often don't show the right launch image, even when using a launch storyboard. Really though, I think you are going to have to bite the bullet at some point and transition to a launch storyboard; fix it once and for all rather than having to g through all of this each time Apple releases a new device size. – Paulw11 Jun 18 '18 at 12:02
  • I have all resolutions as requested in the xcasset LaunchImage (in the picture they are listed). Many people have reported problems with launch image, but no one of the tips I found working. Therefore I have collected all the relevant screenshots in the picture. I hope, someone can tell me what is wrong. – thpitsch Jun 18 '18 at 12:52
  • have you changed bundle ID? are you able to see wrong size of launch image or only black/white screen is appearing? – Dimple Shah Jun 26 '18 at 12:51
  • I haven't changed the bundle ID. It is an app that has been available on the App Store for several years and updates should also be possible for former buyers. The black or white screens only appear on some devices. With each configuration change, this changes without me having been able to establish a correlation. On most devices a launch screen appears, but only with a portrait format that is scaled accordingly. This portrait format also appears in Landscape. – thpitsch Jun 27 '18 at 06:12
  • I think discussion here may be useful for you https://stackoverflow.com/questions/46191522/how-to-add-iphonex-launch-image – Ahmed Wahba Jun 28 '18 at 08:27

1 Answers1

0

If you are using a LaunchImage, you should set that image in the Target settings. Go to your target and under the General tab, set the Launch Images Source value to the image you have in your asset catalog:

enter image description here

Also delete the text LaunchScreen in the Launch Screen File field.

thxou
  • 691
  • 7
  • 20
  • I have now: App Icons Source = AppIcon Launch Image Source = LaunchImage Launch Screen File = [empty] Same Problem as before. – thpitsch Jun 18 '18 at 11:10