开发者

iOS Universal app iPad launch images not being used

I'm following the iOS Programming guide on "Providing Launch Images for Different Orientations" and can't seem to get my iPad-specific launch images to work. If I'm reading the docs right, "Default~ipad.png" should be used as the launch image if I launch my app in the iPad simulator, but instead it's using my "Def开发者_如何学JAVAault.png".

If I tell the simulator to run as an iPhone4, it does correctly use my "Default@2x.png". But that just leaves me more confused as to why the iPad version isn't working.

Anyone know how to make iPad-specific launch images work?


There are a few ways to do this. My preferred way is from the "iOS App Programming Guide"

Providing Launch Images for Different Orientations:

  1. In Info.plist, set UILaunchImageFile to a base name: 'MyAppName.png'

  2. In your bundle, create files using this naming structure:

<basename><orientation_modifier><scale_modifier><device_modifier>.png

Example: I used all these names for iPad, iPhone, 1x and 2x:

MyAppName-Portrait~ipad.png
MyAppName-Landscape~ipad.png

MyAppName-Portrait@2x~ipad.png
MyAppName-Landscape@2x~ipad.png

MyAppName-Portrait~iphone.png
MyAppName-Landscape~iphone.png

MyAppName-Portrait@2x~iphone.png
MyAppName-Landscape@2x~iphone.png

// iphone 5
MyAppName-Portrait-568h@2x~iphone.png
MyAppName-Landscape-568h@2x~iphone.png

Caution: Put the @2x in the right place, this is the one case where it doesn't sit at the end of the filename

This method works particularly well when you have multiple build targets and you don't want to use the Default.png filename


I managed to get it working by supplying an iPad-specific key in the app's Info.plist, rather than using an iPad-specific filename, as the docs suggest.

My Launch image for iPad is "iPadDefault.png" and I added the following key/value in my Info.plist

<key>UILaunchImageFile~ipad</key>
<string>iPadDefault</string>


Since you're doing a universal app, the naming convention changes !

here's a quote form the Guidelines !

Include launch images for both iPhone and iPad. iPhone launch image will still be named Default.png and Default@2x.png. Name your iPad portrait launch image Default-Portrait.png (do not use Default.png as the iPad portrait launch image).

Meaning, there is no portrait/landscape, etc... you just have to rename the files this way:

iPhone(iPod): Default.png and Default@2x.png
iPad: Default-Portrait.png and Default-Portrait@2x.png (the @2x version is for the new iPad !)

Just had the same issue and this fixed it to me, I'm not sure if the left and right orientation is even available on the universal binaries !, but this def works for me !


I finally got both landscape orientation working on ipad, hi res landscape in iphone 4, and low res landscape on the rest using the following (1 landscape orientation for both phones, I use no other orientation or launch properties in plist):

    <key>UILaunchImageFile</key>
<string>Default</string>
<key>UISupportedInterfaceOrientations</key>
<array>
    <string>UIInterfaceOrientationLandscapeRight</string>
    <string>UIInterfaceOrientationLandscapeLeft</string>
</array>

My images are oriented as follows (note that both phone images are rotated 90 clockwise, but appear landscape on phone): Default-Landscape.png (1024 x 748) landscape orientation. Thius is 20 pixels less then the resolution of the iPad. Default.png (320 x 480) portrait orientation (when i look at it in finder it looks rotated 90 deg clockwise from the image above) Default@2x.png (640 x 960) same orientation as above

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜