开发者

iphone OS 4.0- issues in displaying higher resolution images

I am using the new Retina display feature of ios 4.0 in my iphone application. I added the images for higher res开发者_运维问答olution with the naming convention as image@2x.png to my existing image folder.

eg. I am adding the image in the following way:

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

I am having the image named "bg_btm_bar@2x.png" in my image folder as well.

But when I am running my application it is not taking the higher res image.

I am not understanding that how to make the application use the higher res image. Please help me out!


Use imageNamed: instead of imageWithContentsOfFile:

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜