Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c UIImageView动画和视网膜图像_Objective C_Ios - Fatal编程技术网

Objective c UIImageView动画和视网膜图像

Objective c UIImageView动画和视网膜图像,objective-c,ios,Objective C,Ios,我正在使用以下代码在应用程序主屏幕中设置公司徽标的动画: NSArray *array = [[NSArray alloc] initWithObjects: [UIImage imageNamed:@"logo_001.png"], [UIImage imageNamed:@"logo_002.png"], [UIImage imageNamed:@"lo

我正在使用以下代码在应用程序主屏幕中设置公司徽标的动画:

    NSArray *array = [[NSArray alloc] initWithObjects:
                      [UIImage imageNamed:@"logo_001.png"],
                      [UIImage imageNamed:@"logo_002.png"],
                      [UIImage imageNamed:@"logo_003.png"],
                      nil];

    self.imageViewLogo.image = [array lastObject];
    self.imageViewLogo.animationImages = array;
    self.imageViewLogo.animationDuration = 1;
    self.imageViewLogo.animationRepeatCount = 1;
    [self.imageViewLogo startAnimating];

在这种情况下,我应该如何处理视网膜@2x图像?

如果您有视网膜图像:

logo_001@2x.png
logo_002@2x.png
logo_003@2x.png

你不需要做任何事<代码>[UIImage imageNamed:][/code>将返回非视网膜设备的原始图像,并返回视网膜设备的2x图像。

iOS将自动使用@2x图像(如果您的图像名称正确)。i、 e徽标_01和徽标_01@2x. 另外,您不需要放置.png