http://developer.apple.com/library/ios/#qa/qa2010/qa1686.html
|
Q: How are the icon files in my application bundle used on iPad and iPhone?A: Below are guidelines for handling icon files for iPhone-only apps, iPad-only apps, and universal apps. IMPORTANT: Icons marked with "Required" must be supplied in your application bundle. iPhone-only AppsInclude the following in your application's Resources group in the Xcode project: Table 1 : iPhone-only apps icon requirements.
Your Resources group should look similar to Figure 1: Except for iTunesArtWork icon, list the names of each of these files in the iPad-only AppsInclude the following in your application's Resources group in the Xcode project: Table 2 : iPad-only apps icon requirements.
Except for iTunesArtWork icon, list the names of each of these files in the Universal AppsInclude the following in your application's Resources group in the Xcode project: Table 3 : Universal apps icon requirements.
Except for iTunesArtWork icon, list the names of each of these files in the Add Icon files in Info.plistTo add the Open your Then, type " Next, turn down the disclosure triangle on " Note: If you don't provide one of the listed optional icons, the system will automatically scale one of your existing icons to an appropriate size. However, it is strongly recommended that your application supply all the icons listed with specific sizes needed. |
///
http://www.cocoachina.com/bbs/read.php?tid-24549.html
以前貌似发现相关尺寸,这次来点详细的,相信不少人用的到。。。。
从icon说起
命名方法,举例
Icon.png 57×57
Icon-72.png 72×72
Icon-Small.png 29×29
Icon-Small-50.png 50×50
Icon@2x.png 114×114
Icon-Small@2x.png 58×58
另
iTunesArtwork 512×512
在info.plist使用key CFBundleIconFiles,注意与CFBundleIconFile区分开,CFBundleIconFiles的优先级高于CFBundleIconFile
省略扩展名,直接写Icon,会自动识别
如果要加扩展名,必须把所有的图片名都添加到CFBundleIconFiles的array中
特别需要注意的是,如果想自动识别,命名必须严格按照标准,且key为string类型。如果不自动识别,key为array类似并将完整文件名添加进去
Default命名方法
<basename><orientation_modifier><scale_modifier><device_modifier>.png
这个就不多说了,方法和icon是一样的,只列出相关的后缀
<basename>默认为Default,也可用UILaunchImageFile key设置,在这用Default举例
<orientation_modifier> 旋转方向
-PortraitUpsideDown
-LandscapeLeft
-LandscapeRight
-Portrait
-Landscape
None
也就是说你可以Default-Portrait.png 来表示竖屏时的加载图像,同样也可以直接Default.png不指定方向
<scale_modifier>依然是为iphone4准备,用法和icon雷同
Default-Portrait.png与Default-Portrait@2x.png会自动识别
<device_modifier>区分设备,有2个值
~iphone
~ipad
Default-Portrait~iphone.png与Default-Portrait~ipad.png会自动判断设备 同样需要注意的一点,这个在icon里面同样适应,但是貌似现在没有使用的必要,看来未来ipad的分辨率也会扩充一倍?
如果使用了Custom URL Schemes,不多说了,格式如下,用法同上
<basename>-<url_scheme><scale_modifier><device_modifier>.png
如:
Default-myscheme.png与Default-myscheme@2x.png
图片:
如果你的资源目录下有Button.png与Button@2x.png两张图片
那么使用:
UIImage* anImage = [UIImage imageNamed:@"Button"];
将会自动识别图片加载
Add a CFBundleIconFiles
key of type Array to your Info.plist. The array should contain 2 string items: the filenames of the two icons. The OS will then automatically choose the correct icon for each platform based on their pixel dimensions.
You can keep the CFBundleIconFile
key and have it point to the icon file for the iPhone for 3.0/3.1 compatibility.
Update May 2010: Apple now has Technical Note explaining this in great detail: Technical Q&A QA1686 – App Icons on iPad and iPhone