views:

1935

answers:

5

Hi, I created an App which is compatible to iPhone and iPad. Because it is based on HTML (PhoneGap) the App itself is the same for both devices (HTML scales well!). But the launch screen image does not fill out the display on the iPad upon launch.

In my Resorces folder there is only the iPhone launch image which is to small for the iPad, how can I add an other one for the iPad?

+2  A: 

See the answer to this question: http://stackoverflow.com/questions/2634898/splash-screen-for-universal-application-for-ipad-and-iphone

pgb
Thanks for the hint: a second file "Default-Portrait.png" with 768w x 1024h did the job!
powtac
It does not work. The default.png is also shown up on the iPad launch. :( First the Default-Portrait.png is shown an then short after the Default.png (which is too small). When I remove the Default.png file the iPad works correct but no image is shown up on the start of the iPhone. :(((
powtac
+1  A: 

It does not work. The default.png is also shown up on the iPad launch. :( First the Default-Portrait.png is shown an then short after the Default.png (which is too small). When I remove the Default.png file the iPad works correct but no image is shown up on the start of the iPhone. :((( – powtac May 27 at 15:06

I experience this too

breakingart.com
I made some experiences when I added a second folder to Xcode called Resources-iPad and added there a second Default-Portrait.png file. But while testing it, it worked sometimes correct when I swapped(!!!) the files in Resources and Resources-iPad folder!
powtac
It also made a difference if the iPhone-Simulator was closed or not before starting the build. It behaved like the Simulator was started with the last setting and changes the renderer to iPad after(!) it has already shown up the launch image for the iPhone.
powtac
+5  A: 

You need to specify the launch image file (UILaunchImageFile) property in your application's info.plist:

For example, if you set the value for the key UILaunchImageFile~ipad to iPad, your file names should be iPad-Portrait.png and iPad-Landscape.png. You could similarly change it for the iPhone, or use the default (Default.png) for iPhone.

This is defined in Information Property List Files.

Mo
Thanks! I will check this! There are some different offical Apple documentations out there...
powtac
+1  A: 

Hey, I've found a solution to this issue, using phonegap 1.9 dropping this code into your apps delegate should do the trick:

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
    UIImage* image = [[UIImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Default-Portrait" ofType:@"png"]];
    imageView = [[UIImageView alloc] initWithImage:image];
    [image release];

    imageView.tag = 1;
    [window addSubview:imageView];
    [imageView release];
}

That needs to go in the 'applicationDidFinishLaunching' function after the [ super applicationDidFinishLaunching:application ] call.

Iain Carsberg
Thanks for sharing. I will check this too.
powtac
+1  A: 

You need to specify the launch image as mentioned above, but also check to make sure that after the build your launch icons are in the right place. After doing a Build/Run of a PhoneGap project, check the Resources folder in xcode. I found that my additional launch screens and app icons hadn't been moved there in build. Once I copied them in manually and re-built, all the icons and launch screens worked as they should for ipad and iphone.

madmanlear