iPad/iPhone retina display image naming rule

iOS很聰明 ipad跟iphone的影像檔 只要按照官方的naming rule
他就會幫你自動挑選合適的影像

Example:

For devices without retina:
ImageName.png - For iPhone/iPod
ImageName~ipad.png -- For iPad
For devices with retina display:
ImageName@2x.png - For iPhone/iPod
ImageName@2x~ipad.png -- For iPad
程式只需要寫
[UIImage imageNamed:@"ImageName.png"];

icon Size的部份

  1. 57 px, iPhone – Good ol』 classic.
  2. 114 px, Retina iPhone
  3. 72 px, iPad
  4. 144 px, Retina iPad
  5. 29 px, iPhone Settings/Spotlight, iPad Settings – Used in these table views. Minor, but still important!
  6. 58 px, iPhone 4 Settings/Spotlight/Notifications – That's right, you have to make both 57 and 58 px versions of your icon – d』oh! Good luck aligning this if there's a line running down the middle of the icon.
  7. 48 px, iPad Spotlight – Yup, the iPad uses a different size for Spotlight and Settings. Apple's docs actually say the icon is 50 px, but then there's this note: The final visual size of this icon is 48 x 48 pixels. iPhone OS trims 1 pixel from each side of your artwork and adds a drop shadow. Be sure to take this into account as you design your icon. So, leave extra room around your icon.
  8. 96 px, Retina iPad SpotlightSee note 7 above, and remember the edge will be trimmed by 2 px on each side.
  9. 22 x 29 px document icon, iPhone
  10. 44 x 58 px document icon, Retina iPhone
  11. 64 px document icon, iPad
  12. 320 px document icon, iPad
  13. 640 px document icon, Retina iPad
  14. 512 px, iTunes – Used in iTunes and in the App Store, where it's sized down to 175 px. Sadly, you can't provide the 175 px version directly.
  15. 1024 px, Retina iTunes

可以參考這篇
http://mrgan.tumblr.com/post/708404794/ios-app-icon-sizes

See also :

  1. http://stackoverflow.com/questions/9611061/how-to-support-both-ipad-and-iphone-retina-graphics-in-universal-apps
  2. http://developer.apple.com/library/ios/#documentation/2DDrawing/Conceptual/DrawingPrintingiOS/SupportingHiResScreens/SupportingHiResScreens.html#//apple_ref/doc/uid/TP40010156-CH15-SW8

留言

這個網誌中的熱門文章

Office 2021 離線安裝封裝與KMS啟動步驟

Ollama使用心得與模型導入教學

ARC下NSMutableDictionary 無法使用retainCount