0
votes

So I have the following images:

splash1.png (IPHONE 3) [email protected] (IPHONE 4) [email protected] (IPHONE 5)

I want to show the corresponding images in iphone 3, 4, 5.

I tried doing

UIImage * img = [UIImage imageNamed: @"splash1.png"];
self.splashimg.image = img;
[self.splashimg setFrame: CGRectMake(0, 0, img.size.width, img.size.height)];

Where self.splashimg is an imageview that shoes the image img.

but this still shows the iphone 3 image and does not get the iphone 4 or 5 image.

what can I do?

When I look at the app in iphone 5, I see the splash image but the iphone 3 version of it.

1

1 Answers

2
votes

There is no provision in UIKit for a general -568h@2x device modifier: it will only work for Default.png.

So, this explains why your app is not using the iPhone 5 specific version of your images.

In any case, it should be able to use the @2x version of your files, so I would suggest checking that [email protected] is there and it is not corrupt or in a wrong format, etc.

You can find an extension to UIImage (via a category) to support the use of the -586@2x device modifier here: https://gist.github.com/3711077.