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条回答
forever°为你锁心
2楼-- · 2019-03-11 01:51

Make sure the image is not transparent. In my case it is transparent instead of white

查看更多
老娘就宠你
3楼-- · 2019-03-11 01:52

The marked solution helped me figure out my problem:

I had added all the different sizes for the Launch Images, but during launch I would see a white background with black letters "(my app name)" in the center of the screen, with "copywrite (my name)" in small letters along the bottom.

I had specified the "Launch Images Source" to my Images.xcassets file, and added all the images for the correct sizes, but I did not notice that the "Launch Screen File" was still the default value of "LaunchScreen".

I made the "Launch Screen File" entry blank,and it started to use the Images.xcassets files correctly.

Thanks!

This was Xcode 6.1 running on the simulator, ios8.

查看更多
Emotional °昔
4楼-- · 2019-03-11 01:52

For anyone stumbling on this question as I did:

If your app is landscape only, it won't load the LaunchImage if portrait is not a "supported orientation". You should always have portrait selected, next to the landscape orientation(s) you want to support.

See also: This question

查看更多
登录 后发表回答