Images for retina display iphone

删除回忆录丶 提交于 2020-01-01 04:26:08

问题


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


回答1:


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.




回答2:


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


来源:https://stackoverflow.com/questions/6136985/images-for-retina-display-iphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!