Ios UImage未显示iphone 4/5版本

Ios UImage未显示iphone 4/5版本,ios,objective-c,ios4,Ios,Objective C,Ios4,因此,我有以下图像: splash1.png(iphone3) splash1@2x.png(iphone4) 飞溅1-568h@2x.png(iphone5) 我想在iPhone3、4、5中显示相应的图像 我试过了 UIImage * img = [UIImage imageNamed: @"splash1.png"]; self.splashimg.image = img; [self.splashimg setFrame: CGRectMake(0, 0, img.size.width,

因此,我有以下图像:

splash1.png(iphone3) splash1@2x.png(iphone4) 飞溅1-568h@2x.png(iphone5)

我想在iPhone3、4、5中显示相应的图像

我试过了

UIImage * img = [UIImage imageNamed: @"splash1.png"];
self.splashimg.image = img;
[self.splashimg setFrame: CGRectMake(0, 0, img.size.width, img.size.height)];
其中self.splashimg是一个图像视图,用于显示图像img

但这仍然显示了iPhone3的图像,没有显示iPhone4或5的图像

我能做什么


当我查看iphone 5中的应用程序时,我看到的是splash图像,而不是iphone 3版本的图像。

UIKit中没有提供通用的
-568h@2x
设备修改器:它仅适用于
Default.png

因此,这就解释了为什么你的应用程序没有使用iPhone 5特定版本的图像

无论如何,它应该能够使用文件的
@2x
版本,因此我建议检查
splash1@2x.png
存在且未损坏或格式错误等

您可以找到
UIImage
(通过类别)的扩展,以支持
-586@2x
此处的设备修饰符: