【问题标题】:iphone OS 4.0- issues in displaying higher resolution imagesiphone OS 4.0-显示更高分辨率图像的问题
【发布时间】:2010-08-30 07:55:27
【问题描述】:

我在我的 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”的图片。

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

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

【问题讨论】:

    标签: iphone


    【解决方案1】:

    使用 imageNamed: 代替 imageWithContentsOfFile:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-10-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多