Nothing earth shattering here, but it’s not clearly spelled out in the documentation…at least not in an easy to find manner. If you have an image, let’s say background.png, you should create three separate images.
- background~iphone.png – Used on non retina-display iPhones
- background@2x.png – Used on retina display iPhones
- background~ipad.png – Used on iPad devices
Note that those are tilde characters, not dashes. When you want to grab that image, you simply pass the name “background” to UIImage’s imagedNamed: method and it will grab the proper one for you. Keeps you from having to create special naming conventions that you put in your code as Apple has already done it for you. This will likely change when the new iPad comes out if the rumors of retina display there are true, but for now, those are your names.
From: http://gargoylesoft.com/blog/2011/03/naming-images/
本文介绍了iOS应用中图像资源的命名规范,包括不同设备及分辨率下图片文件的命名方式,以便于开发过程中根据不同设备自动加载合适的图像资源。
94

被折叠的 条评论
为什么被折叠?



