0

I added the images to the LaunchImage asset for both iOS 7.0 and later, and iOS 7.0 and prior. The correct image is used as launch image for all the screen sized and resolutions. Now I'm trying to use the same asset to add a background image using the following code:

self.backgroundImage = [UIImage imageNamed:@"LaunchImage"];
UIImageView *backgroundView = [[UIImageView alloc] initWithImage:self.backgroundImage];
[self.view addSubview:backgroundView];

However, the R4 image is never loaded. It only loads the 2x image. This is a problem for 4 inches devices because the only image that has the right size (640 x 1136 pixels) is the R4 one.

I understand R4 images are only meant to be used only for iPhone and later with iOS7 and later, but it doesn't even work when I use 4-inch 64-bit iOS simulator, and even if it does what about the 4-inch with iOS6 and prior?

Diego A. Rincon
  • 747
  • 1
  • 8
  • 25
  • 1
    possible duplicate of [Xcode 5 & Asset Catalog: How to reference the LaunchImage?](http://stackoverflow.com/questions/19107543/xcode-5-asset-catalog-how-to-reference-the-launchimage) – memmons Jul 07 '14 at 19:08

1 Answers1

0

You have to change the iOS project Target to iOS 7 for the R4 image to be automatically selected by Xcode. The other 2x image will load in lower versions.

Rachel Gallen
  • 27,943
  • 21
  • 72
  • 81
  • 1
    Another option is to use localized launch images, rename the launch images as default.png , default@2x.png and default-568@2x.png, bundle them and set ios to recognize automatically – Rachel Gallen Jul 07 '14 at 19:11
  • How can I set iOS to recognize a default-568@2x.png automatically? I thought only default.png and default@2x.png will be called automatically. – Diego A. Rincon Jul 07 '14 at 19:29
  • @DiegoA.Rincon those are the only two you need i suppose but i know some people still bundle in a default-568 and it works You have to put them all in a bundle togetther – Rachel Gallen Jul 07 '14 at 19:32