Launch Screen storyboard not displaying image

后端 未结 30 1516
忘了有多久
忘了有多久 2020-12-07 09:50

I\'m trying to get an image to display as the launch screen from my Launch Screen.storyboard file, however the image never displays. I have labels that show up fine, but the

相关标签:
30条回答
  • 2020-12-07 10:33

    In my particular case, the splash screen worked for the simulator and other devices, but stopped working for one specific device. This lead me to believe that it was some caching data kept by xcode (v10 and iPhone 7 v12.1).

    I deleted the derived data at: ~/Library/Developer/Xcode/DerivedData/ only emptying the folder contents, not deleting the folder. I then rebooted the mac and the iPhone and cleaned and rebuilt the project, and now it is showing up.

    I'm not sure if all of this was necessary, but didn't want to waste any more time narrowing it down, so the above sledgehammer approach worked for me. But of course it always depends on your specific situation - mine was device specific; for others it could be the actual image or launch screen layout etc.

    0 讨论(0)
  • 2020-12-07 10:34

    Had the same issue, adding the image to the "Build Phases -> Copy Bundle Resources" fixed it for me.

    0 讨论(0)
  • 2020-12-07 10:35

    Well As of now there is retina device available and I ignored @1x image in Assets.xcassets.

    In my case, I have app logo in Splash screen which is not visible when I run the application.

    After wasting so much time I figured out that I only provided @2x and @3x images for that logo image.

    This issue is resolved by adding @1x version of that image.

    0 讨论(0)
  • 2020-12-07 10:36

    Very frustrating. Solution that finally worked:

    1. Do hard reboot of device

    2. Delete app

    3. Install app from Xcode

    0 讨论(0)
  • 2020-12-07 10:39

    I spent hours on this problem before finally realizing my mistake. When you add an image to a UIImageView, it will use just the name of the image. If your images are in a different folder than your storyboard, they will show up in xcode but not when running the app. You must add the appropriate file path prefix, for example, images/image.png. It will now appear as a blue question mark in xcode, but it will work in the app.

    0 讨论(0)
  • 2020-12-07 10:40

    My first mistake was, that I created a normal .storyboard, renamed it and defined it as launchscreen in the project settings. I this case I had image problems. It seems that some settings are missing in this case then, so I just created a new file via file->new and picked directly the "Launch Screen" and then it worked.

    Also I had in mind that, that layout constraints are not supported in the launchscreen for some reason. Maybe it was like that in the beginning, not sure, but now constraints should work.

    Maybe this helps anyone.

    0 讨论(0)
提交回复
热议问题