Search code examples
iosxcodelaunchimage

ios/xcode: Get launch image to display


I have been trying without success to get a launch image (screenshot from app) to display. I tried adding it as a file named Default.png to the project as apparently people did back in the day. (Adding icon.png to the project is the only way I've been able to get the icon to appear.)

I also tried the newer version suggested by apple of going into imgcassette and creating a launchImage set. I don't have separately sized images for all the possible combinations but did drag and drop my screenshot onto most of the spaces (i.e. those for a phone as opposed to iPad). According to what I've read once you do this, it is supposed to just work.

However, no matter what I do, the image is not displaying. Instead I just get black screen. My target device is an iPhone 4s running IOS7.

Can anyone suggest what else to try?

Thanks.


Solution

  • You will need to use the asset catalogs or the launchscreen.xib file.
    In the main project file scroll down until you see something similar to this and click "Use Asset Catalog" and then "migrate" or something like that. Also, remove the launchscreen.xib from the "Launch Screen File" if you prefer using the asset catalogs.

    set launch image source to using assets

    Next, navigate to Assets.xcassets in the sidebar. There you will see something like the following:

    asset catalog

    Here, drag and drop the launchscreen images you imported into your project onto the appropriate slot.

    That should do it.
    Hope this helps :)