cordova/cordova-ios — Issue #12: Default image not correctly read from info.plist
Author: nicklockwood
Created: 2012-03-02 16:05:49+00:00
State: open

When using a custom splash screen image on iPhone, PhoneGap incorrectly replaces the name in the info.plist with Default.png. The bug is shown below:

- (void) showSplashScreen
{
NSString* launchImageFile = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"UILaunchImageFile"];
if (launchImageFile == nil) { // fallback if no launch image was specified
launchImageFile = @"Default";
}

NSString* orientedLaunchImageFile = nil;
CGAffineTransform startupImageTransform = CGAffineTransformIdentity;
UIDeviceOrientation deviceOrientation = [UIDevice currentDevice].orientation;
CGRect screenBounds = [[UIScreen mainScreen] bounds];
UIInterfaceOrientation statusBarOrientation = [UIApplication sharedApplication].statusBarOrientation;
BOOL isIPad = [[self class] isIPad];
UIImage* launchImage = nil;

if (isIPad)
{
...
}
else // not iPad
{
orientedLaunchImageFile = @"Default"; <-- here is the bug, this should be "orientedLaunchImageFile = launchImageFile;"
launchImage = [UIImage imageNamed:[[self class] resolveImageResource:orientedLaunchImageFile]];
}

...
}