开发者

iPhone & iPad Apps Launch Images

开发者 https://www.devze.com 2023-03-17 08:51 出处:网络
Preamble: This is intended to be be a canonical question (and answer) on iOS Apps launch images (aka Default.png).

Preamble: This is intended to be be a canonical question (and answer) on iOS Apps launch images (aka Default.png).

Questions

  1. What is the best way to set the Default.png; Manually in the Info.plist or using Xcode (supported in xcode-4 only, I think)
  2. Does the iPhone auto-rotate the Default.png depending on the device orientation?
    • What effect does the UIInterfaceOrientation (Initial interface orientation) key in the Info.plist have?
    • Does UISupportedInterfaceOrientations and UISupportedInterfaceOrientations~ipad have any effect on displaying the Default.p开发者_StackOverflowng
  3. Can I set different Default.png for the iPad using these file names?:
    • Default-Portrait.png
    • Default-PortraitUpsideDown.png
    • Default-Landscape.png
    • Default-LandscapeLeft.png
    • Default-LandscapeRight.png
  4. Are there iPhone equivalents (see 3)
  5. Is there any Apple documentation that covers all aspects of "Launch Images"? If so, where?

NB: It seems the usage of launch images changes quite frequently between SDK releases, please indicate in your answers what version you are talking about


5) Is there any Apple documentation that covers all aspects of "Launch Images"? If so, where?

There's something here:

Supply a launch image to improve user experience.

Avoid using it as an opportunity to provide:

  • An “application entry experience,” such as a splash screen
  • An About window
  • Branding elements, unless they are a static part of your application’s first screen


Partial answers based on latest iPhone iOS

  1. Manually in the Info.plist or using Xcode (supported in xcode-4 only, I think)

These two methods are equivalent. Xcode merely presents a convenience editor UI for the info.plist. There is no other way to specify the launch image (available to 3rd party developers) than setting it in info.plist.

  1. Does the iPhone auto-rotate the Default.png depending on the device orientation?

No. but as Springoard does not support upside down, it is unlikely that any portrait apps are launched upside down.

What effect does the UIInterfaceOrientation (Initial interface orientation) key in the Info.plist have?

None

Does UISupportedInterfaceOrientations and UISupportedInterfaceOrientations~ipad have any effect on displaying the Default.png

No.


In my experience, the simplest approach with the easiest maintenance is to simply follow Apple's conventions when naming your launch image files. If you carefully read and follow those naming conventions, everything else becomes automatic. Automated features include:

  • Choosing different launch image files for different device screens.
  • Handling the new taller screen found on current iPhone 5/5S & iPod touch.
  • Handling Retina screens.
  • Handling device orientation (Portrait vs Landscape) on iPad. (handhelds have only Portrait)
  • Displaying thumbnails in Xcode 4

If you:

  • Create image files with the correct resolution (carefully read the doc, as resolutions are not what you might expect)
  • Follow the naming rules documented by Apple
  • Place the files at the top level of your app bundle†

…then:

  • Thumbnails of the images will automatically appear within project settings of Xcode 4.
  • Your launch images will automatically be used on devices as well as the iOS Simulator.

By following the naming conventions, you need not:

  • Select images manually in the Xcode project settings
  • Edit any info-plist

The naming conventions work at least in iOS 5, 6, and 7. I believe they also work in earlier versions as well.


†Image files should not be nested in any physical folder. After adding them to Xcode, you may group them into a virtual folder within Xcode's project listing to avoid visual clutter.


Tip: To verify which image is being used, alter the image itself to display the file name as part of the image. Make a backup of your images first, of course.

0

精彩评论

暂无评论...
验证码 换一张
取 消