Mercutio
Mercutio

Reputation: 1296

image view only shows background color in launch screen

I'm having some problems with my app's launch screen storyboard.

When I run the app on an iPhone 5S, the image is displayed. However, when I run the app on an iPhone 8, the background color of the UIImageView is shown.

In the project settings, at App Icons and Launch Images, I am not using an image source (although trying do so doesn't seem to work either) and the Launch Screen File is set to LaunchScreen.

The View Controller has Is Initial View Controller checked and the file has Use as Launch Screen checked. The image set was brought in using Import... and is universal.

I've read through several of the solutions for black screen here, but switching the background color revealed that was where my black screen was coming from.

In the assets file, the image set has 1x @ 640x1136, 2x @ 1242x2208 & 3x @ 1125x2436. I experimented with other combinations, but this is the first set that let me see the actual image on the 5S. I'm pretty sure the issue is not having the right configuration of dimensions in the image set file, but can't be certain.

Any help would be much appreciated. Thanks in advance.

Upvotes: 0

Views: 736

Answers (1)

Tung Fam
Tung Fam

Reputation: 8147

Had the same thing. Working on the simulator but didn't work on the device (or any other possible option). It's just a bug.

Try these until it works:

  1. Turn simulator/device off and then on again.
  2. Hard clean simulator. Turn it off.
  3. Clean/Hard Clean/Delete Derived data
  4. Reboot Xcode

Hope one of these helps.

If not, please include the screenshots of working / non-working app screens.

Upvotes: 1

Related Questions