Images for retina display iphone

2019-03-25 04:42发布

I have an working application which i have tested in my ipod touch. Everything works pretty fine.

My tabbar icons and splash screen images are in a separate folder in my Resources folder

Resources->images

Now, I know for iPhone4 i need to use 2x images.

My question is for support for iPhone4 all that i need to do is add 2x images in my images folder. For example if my splashscreen image is Default.png, I should add my 2x image as Default@2x.png in my images folder and iphone will use it automatically.?

Is it the same for all tabbar images ?

Thanks in advance

2条回答
做自己的国王
2楼-- · 2019-03-25 05:26

Yes, all that you said is correct. Remember to also import the @2x images into your Xcode project (e.g. by dragging them from Finder to Xcode), so they'll be added to the bundle when you build your app.

查看更多
别忘想泡老子
3楼-- · 2019-03-25 05:33

For the apps I have worked on, I have only one image in this format:

myImage@2x.png

When I reference this image, I make the following call and it always works, whether on a 3GS/iPhone 4 or iPad.

[UIImage imageNamed:@"myImage.png"]
查看更多
登录 后发表回答