2010-08-30 98 views
0

我在iPhone應用程序中使用了ios 4.0的新Retina顯示功能。 我使用命名約定將圖像更高分辨率添加爲[email protected]到我現有的圖像文件夾。iphone OS 4.0-顯示更高分辨率圖像的問題

例如。我以下面的方式添加圖像:

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]]; 

我在圖片文件夾中也有名爲「[email protected]」的圖片。

但是當我運行我的應用程序時,它沒有采用更高分辨率的圖像。

我不理解如何讓應用程序使用更高分辨率的圖像。 請幫我一把!

回答

0

使用imageNamed:而不是imageWithContentsOfFile: