Supporting graphics for both Retina and Non Retina display

巧了我就是萌 提交于 2019-12-06 05:17:41

You must make two versions of each image. For example, if you had a 544x151 image for retina, say its called 'background@2x.png', make a 272x75 version for non retina display, which would be 'background.png'

Name all retina images with the suffix "@2x.png". The OS will automatically present the @2x images on retina devices. So to conclude:

272x75 would be "background.png" 544x151 would be "background@2x.png"

This also is the correct way to make icons compatible with retina devices. Just make a 114x114 (iphone) or 144x144 (ipad) and name it "icon@2x.png".

You need to name your retina images with a "@2x.png" suffix.

So if you have an image "pic.png" this should be for non-retina, and "pic@2x.png" should be at retina scale. You should select the "pic.png" image and not the @2x one when placing it in the storyboard/xib/UIImage.

The storyboard based image will automatically pick the retina image if needed.

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