neeraj
neeraj

Reputation: 1221

Launch image gets displayed when it should not - iOS

My app is meant to open (or if it just returns from background) only in portrait mode, even when it went to background in landscape or if it is being opened when the orientation of the device is landscape.

In iPad, whenever the orientation of the device is landscape, and I bring the app to foreground, the launch image shows up. This doesn't happen if the device orientation is portrait. (Also, I there are no launch images for landscape orientation in the project)

Also, there is a task that I do when app is going to the background. If I go to background and come back to foreground very fast, launch image shows up in both iPhone and iPad, even if the orientation is portrait.

is there any way to prevent it from showing up?

Upvotes: 2

Views: 401

Answers (1)

icodebuster
icodebuster

Reputation: 8964

Create your launch images, as of iOS 5, at least four for the iPad and three for the iPhone. Name your images as follows: (The name I am using is only an example, you can use any you want.)

iPadImage-Portrait.png
[email protected]
iPadImage-Landscape.png
[email protected]

iPhoneImage.png
[email protected]
[email protected]

Make sure you use a distinct name for each device.

Place all of these images in the top of your app's bundle directory. Then all you do is add two keys to YourAppName-Info.plist.

Launch Image(iPad) string iPadLaunchImage
Launch Image(iPhone) string iPhoneLaunchImage

Images will load properly for both devices. Note that in the Info-plist file you don't put the .png, only the base name you used for your images.

Apple Docs

Upvotes: 2

Related Questions