Retina compatibility question: Can I add @2x to my own images for retina compatibility?

走远了吗. 提交于 2019-12-09 18:44:12

问题


If I append the @2x suffix to my own images, will iOS 4 automatically replace my images with the Retina compatible ones, or does that only apply to Apple defined images? (Icons, for example.)


回答1:


Yes, of course. If you display a myimage.png in your app, you may add a retina ready myimage@2x.png, so it is shown on retina devices.

See this guide for further information.




回答2:


From the documentation:

The bundle- and image-loading routines automatically look for image files with the @2x string when the underlying device has a high-resolution screen.

So using for example [UIImage imageNamed:@"MyImage.png"] will automatically look for MyImage@2x.png when running on a device with retina display.



来源:https://stackoverflow.com/questions/3937204/retina-compatibility-question-can-i-add-2x-to-my-own-images-for-retina-compati

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