iPhone/iPad apps的图标及启动图片
参考下面的表格,相关参数已更新到iOS4.3及Xcode4:
Typical icons are PNG files with 90 degree corners, but no transparency, no layers, and set to 72 PPI. iPhone OS applies rounded corners, optionally shine, and other effects. If you have added these effects let your programmers know it. When you do not let the iPhone/iPad OS to apply the gloss to your icons, developers must add a key to info.plist called UIPrerenderedIcon and make it checked. The standard bit depth is 24 bits + 8-bit alpha channel.
Designers and programmers alike understand now that the sizes of items on iPhone/iPad screens are not constants. Differences in screen size and zoom functionality are common place, but PNG format and 72 PPI is still the default. (PNG discards pixel density. Most image editors, including Adobe Photoshop, assume that an image’s pixel density is 72 if the information is not stored.)
iPad icons can be tricky. Some designers release the standard iPad icons only but fail to include some crisp small size icons as options for OS. Add some tiny iPad icons to your project in the sizes of 64×64, 32x32px, 24x24px and 16x16px. Programmers know how to include these files (see Info.plist).
You should know that when the user taps on the main application icon the app immediately starts to load. It’s important to make the launch time as short as possible. Every iPhone/iPad app should ship with a launch image which mimicks the interface by using a static image. The launch image should be as small a file as possible to ensure quick loading. Do not create image files in the megabyte territory.
Notes for developers:
In the Info.plist file developers specify the orientations the application supports along with the related launch images. If missing, they must add these lines:
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
Developers may change previous naming conventions, as we did, and use their own custom name of icon and launch image files. We usually want to configure our iPad applications differently from iPhone versions, so we specify device-specific values for Info.plist keys. For example:
Sample icon and launch image settings in Info.plist for universal applications. Platform: iOS 3.2+
iOS documentation: “The image files used to represent icons and launch images must all reside in the root level of your bundle. How you identify these images to the system can vary, but the recommended way to specify your application icons is to use the CFBundleIconFiles key… In addition to the icons and launch image at the top level of your bundle, you can also include localized versions of those images in your application’s language-specific project subdirectories”. The filenames can be anything you want, but all image files must be in the PNG format.
1. If your iPhone application supports running in iOS 3.1.x or earlier, you cannot use the CFBundleIconFiles key to specify your icon files. You must create icons of the same size as listed in our table, but each image must be named as follows:
Icon.png – Application icon on iPhone or iPod touch
Icon-72.png – iPad application icon in a Universal application
Icon-Small.png - Search results and Settings icon on iPhone and iPod touch
Icon-Small-50.png – Search results in iPad applications
Since version 3.2 if you specify an Icon-Small.png or Icon-Small-50.png file in your bundle, the system prefers those icon files over the ones in the CFBundleIconFiles key and the iOS prefers the application icon defination in the CFBundleIconFiles key over any other one.
2. The iOS is finally making the move into resolution independence and your image objects aren’t measured in pixels, but in points. Points don’t always correspond to pixels. The screen size of the iPhone 3 is 480×320, in both points an pixels. The iPhone 4′s screen size is 960×640 in pixels, but its logical screensize still remains at 480×320 in points. Keep your frame, point and size values in their original values and still support larger resolution devices. On iPhone 4 you may insert “@2x” in the name of the image file and it will be used automatically on the higher resolution devices. Use like “button1back@2x.png”. The simulator of XCode 3.2.6 still reports screen size of 320×480, but see what you have done… on a hires device.
Check out UIScreen class reference for properties of bounds and currentMode. The bounds property gives us the rectangle of the screen in points.The currentMode.size property represents the screen size in pixels. For example, since iOS 4, [UIImage imageWithContentsOfFile: ] recognises when an image has the ’2x’ version and displays it correctly.
3. In the Info.plist, at the CFBundleIconFiles key, if you do not specify the filename extensions for launch and icon images, you can avoid listing all of the 2x variations, and the Info.plist would look like this:
Sample icon image settings in Info.plist for universal applications. Platform: iOS 4+
iOS 4+ comment: As you can see, the hi-res version of the same launch image should be named launchimage@2x.png. If you did not specify a custom launch image name, these files must be named Default.png and Default@2x.png, respectively. If you include a filename extension, you must explicitly add the names of all image files. For universal iPhone/iPad apps the orientation-specific launch image filenames can be as follows:
<basename><orientation_modifier:-Portrait or -Landscape><scale_modifier: @2x><device_modifier: ~ipad or ~iphone>.png , like
launchimage-Portrait.png,
launchimage-Portrait@2x.png,
launchimage-Portrait~ipad.png,
launchimage-Landscape~ipad.png...
If you do not specify a custom launch image filename, you must use the names of Default-Landscape.png and Default-Portrait.png.