David
David

Reputation: 305

launch images for multiple targets with universal app

I have multiple targets for my universal app and when I drag an image to the "Launch Images" summary section in xcode, it overwrites the launch image for all the other targets. Is there a way to have different launch images for each target? thanks

Upvotes: 10

Views: 2945

Answers (5)

xevser
xevser

Reputation: 369

Add multiple launchImages files in Images.xcassets. select target launch Image on each target's General Section. Be sure each target's "copy bundle resources" has Images.xcassets folder.

Upvotes: 1

Scott Driscoll
Scott Driscoll

Reputation: 2929

I had everything working by using a different plist file for each target, and adding suffixes as recommended (@2x, -568@2x, and in my case, -Landscape for iPad).

However, only a blank screen was showing for an iPod running 6.1, even though it showed correctly on the iPhone 5 also running 6.1, and on the simulator. I ended up having to add "Default.png" copies of the 320x480 splash to each target, using the "Target Membership" in the File Inspector to control which target the image should be used for.

Upvotes: 1

Toby
Toby

Reputation: 390

I was able to figure out the solution using these directions, but here it is a little more explicitly.

For each target's set of launch images, you need to have a separate root filename and then @2x and -568h@2x versions of the same image for Retina and iPhone 5 displays. Then you add a row to the info.plist for each build target, specify that the key is "Launch image", and enter the filename of the standard-resolution version.

So, for example, say you wanted two build targets: Lite and Standard. You could have two sets of launch images:

Lite:

Default.png
[email protected]
[email protected]

(in this case you don't have to specify a launch image key in the info.plist, since it will use Default.png by default)

Standard:

Default-Standard.png
[email protected]
[email protected]

Then you'd select the "Standard" build target in xcode, click the info tab, right click one of the rows and click add row. It's a little confusing because when it adds a row that row has a random key value already entered instead of a blank one. Click the newly added key name and change it to "Launch Image". Then in the Value space, you'd enter "Default-Standard.png". Click the "Summary" tab (next to the info tab) and scroll down and you should be able to see correct previews of your launch images.

Hope this helps!

Upvotes: 8

Serhii Mamontov
Serhii Mamontov

Reputation: 4932

You can configure "Info.plist file" key-value inside "Build Setting*" for project. In different plist files you can specify startup image and other settings if out want.

Upvotes: 1

alloc_iNit
alloc_iNit

Reputation: 5183

For an universal to differentiate each image for target, just set suffix like "-ipad".

Upvotes: 0

Related Questions