iPhone 5 - what naming convention the new images have to follow?

独自空忆成欢 提交于 2019-11-26 15:31:52

问题


What name convention the new images have to have to be loaded by the new iPhone 5?

We see that we have to have 3 default images to be loaded by the device

Default.png
Default@2x.png  and
Default-568h@2x.png

what about the other images used by an app?

Is there a naming convention that will automatically load the correct image?


回答1:


The new default is Default-568h@2x.png. (note hyphen)

There is no other corresponding change. If you need a different image for the new iPhone 5 screen then you have to create it as a separate name. There is no 1x/2x/new phone auto switching behavior.




回答2:


If you are looking for something similar to ~iPad or ~iPhone (like ~586h) there isn't anything build in like that. But you can easily add it yourself by expanding UIImage class.

Have a look at this source snippet (UIImage+Retina4) for information about how to achieve. Just add this UIImage category and there will be support for ~568h@2x files.




回答3:


I solve this problem here. Just add @2x~568h suffix to images or ~568h to xib's. Also you can use this images in xib's.




回答4:


With the introduction of Asset Catalog in Xcode 5, all you have to do with the images is simple drag and drop to its corrosponding related areas. Everything else will be handled by the Xcode itself.

.

You can create new catalog by going to the above mentions option in the screenshot.



来源:https://stackoverflow.com/questions/12431445/iphone-5-what-naming-convention-the-new-images-have-to-follow

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