iphone OS 4.0-显示更高分辨率图像的问题

时间:2010-08-30 07:55:27

标签: iphone

我在iphone应用程序中使用了ios 4.0的新Retina显示功能。 我将更高分辨率的图像添加到我现有的图像文件夹中,命名约为image@2x.png。

例如。我按以下方式添加图像:

UIImageView * toolBarBg = [[UIImageView alloc] initWithFrame:CGRectMake(0,0,320,88)];

NSString * toolBarBgImgPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@“bg_btm_bar.png”];

[toolBarBg setImage:[UIImage imageWithContentsOfFile:toolBarBgImgPath]];

我的图像文件夹中也有名为“bg_btm_bar@2x.png”的图像。

但是当我运行我的应用程序时,它没有拍摄更高分辨率的图像。

我不明白如何使应用程序使用更高分辨率的图像。 请帮帮我!

1 个答案:

答案 0 :(得分:0)

使用imageNamed:而不是imageWithContentsOfFile:

相关问题