Launch images show black, when using Asset Catalog

2019-03-11 01:01发布

In Xcode 5, I use the asset catalog to manage the app icons and launch images for my app. The app icons work fine on all devices, but the launch images just on a few.

I have added launch images for every possible device, and iOS (6.1 and 7.0), that I want to target. I have made sure that all images have the correct sizes, which is confirmed in the attributes inspector (see picture below) where the size of the images match the expected sizes. I have also named all images after the naming conventions, which should not even be necessary with asset catalog (see last picture). There does not seem to be any naming conventions for iOS7 launch images running on iPhone, so I have simply named them "iphone4_iOS7" and "iphone5_iOS7".

Xcode, when viewing launch images in asset catalog

Names I have given the launch images



The launch images shown in the simulator when I run on iOS7 all turn up completely black, no matter which device. I also get this behaviour on my iphone 5, which confirms the simulator is not the problem. The same black image is shown when I run iOS6 in the ipad and ipad retina simulators. The launch images for the iphone simulators with iOS6 works as expected.

I have numerous times, both in simulator and on device, deleted the app and cleaned but it has not resulted in any improvement.

What am I doing wrong? How can I get rid of the black launch images and get the images I set in the asset catalog to show instead?

9条回答
干净又极端
2楼-- · 2019-03-11 01:28
  • delete your app from your device
  • cmd + shift +k in your Xcode. then build it into your Device

launching images, only will be visible on your device if you reinstall on your device

UPDATE:

There is a weird issue what I found. If you are using LaunchScreen.xib and you have images in it, you have to do the tasks above and TURN OFF your device... (seriously...). Every image will be updated in the next build.

查看更多
一夜七次
3楼-- · 2019-03-11 01:28

I have same problem. Tried all the solution posted here. Still nothing. Black screen only. After trial and error here and there, I found the solution. Delete the "Launch screen interface file..." in your project's PLIST. Delete the entry.

enter image description here

Delete the ENTIRE LINE!!! Don't leave it there with empty value.

Hope this helps someone.

查看更多
闹够了就滚
4楼-- · 2019-03-11 01:32
  • Make sure your images are accurate size according to Apple guidelines.
  • Make sure, You will select only one option , either launch screen file or Launch Image Source. You can find these two options in Project build settings -> General

My suggestion to you is to select Launch Image Source as Image.Assets. Create splash image assets there in Image.assests folder.

Reference image for right configuration:

enter image description here

查看更多
相关推荐>>
5楼-- · 2019-03-11 01:39

Make sure that Launch Screen File is empty! Making it empty solved the issue in my case

enter image description here

查看更多
走好不送
6楼-- · 2019-03-11 01:39

Although this isn't the OPs issue in this case, this is for anyone was has multiple targets in their project: also make sure the asset catalog is included in all targets (if you're using a single catalog for all targets). In my case it had defaulted (or I had set it at some point in the past) to the first target, and thus my other targets had no launch screen. Strangely, they still had icons.

查看更多
Lonely孤独者°
7楼-- · 2019-03-11 01:49

Have you changed the setting for your project so that it points to the Asset Catalog as the source for your Launch Image?

enter image description here

查看更多
登录 后发表回答