I'm trying to set the splash screen on a react-native app that I intend to deploy for iOS devices.
As we all know, there are a few different screens to target (varying by pixel density, aspect ratio, and other things), so I've got to provide a handful of images. There appear to be at least three methods of providing the mapping that allows iOS to decide which image to use in any scenario; it's my understanding that any one of these approaches is supposed to be sufficient by itself:
Default.png
, Default@2x~ipad.png
, [email protected]
, etc.)UILaunchImages
dictionary item in the project's Info.plist, with a dictionary entry for each scenario that points to the desired imageMy strong preference is to use the third approach, in large part because it requires the least amount of technical precision as far as defining the identifying characteristics of each display scenario. But it's not working when I test on my iPhone5 -- the splash screen is black, instead of showing my colorful image. I've placed an image in every spot on the LaunchImage board, which suggests to me that the LaunchImage skeleton that ships with Xcode6 simply doesn't have a spot that corresponds to iPhone5. That can't be right. (Yes, my images are PNGs.)
A lot of tutorials tell me to create a new Image Set in the asset catalog (it has a different skeleton), but the "App Icons and Launch Images" configuration only permits me to choose items that are LaunchImages.
There are lots of resources online that document the first two approaches -- i.e. relying on the filesystem convention, or defining the mapping in the Info.plist -- but nothing that seems to really address the asset catalog approach.
Can someone point me in the right direction?
EDIT: Interestingly, when I put my @1x image in every spot on the LaunchImage board, the project fails to build because "there is no applicable content." When I put my @2x image in all the Retina spots, the app builds, but the splash screen is black.
Does this reveal something?
After a bit of experimenting, it turns out that the phone was silently rejecting the image that had been assigned to that scenario because the image dimensions weren't correct. The image I provided was very slightly larger than appropriate, and apparently the way iOS handles this is to show a black launch screen without emitting any kind of useful diagnostic information.
I got the exact dimensions from this SO post.