Splash Screen appears twice on iPad application

1,368 views
Skip to first unread message

Gazzer

unread,
Jun 13, 2010, 5:39:54 AM6/13/10
to phonegap
I'm developing an Application for both the iPad and iPhone using
PhoneGap 0.9.1 . So I have the Default-Landscape.png Default-
Portrait.png and Default.png but when I launch the application in an
actual iPad, the (smaller) Default.png images appears after the
Default-Landscape.png (or Default-Portrait.png) then disappears. (This
happens using the both iPad and 'non-iPad' XCode files).

Any ideas how to prevent this?

Many thanks.

chall

unread,
Jun 14, 2010, 10:53:23 AM6/14/10
to phonegap
I got around this by making Default.png a fully transparent image in
Photoshop.

Gazzer

unread,
Jun 15, 2010, 2:27:30 AM6/15/10
to phonegap
Unfortunately, then there is effectively no splash screen for the
iPhone which means the user is left waiting with a blank screen for a
few seconds (especially if they have a iPhone 3G this can be 8 or more
seconds). So this would seem to be a bug. Is there really no way round
it such as setting a different name for the images etc?

N

unread,
Jun 20, 2010, 12:13:53 PM6/20/10
to phonegap
It's definitely a bug, and one that will get a PG app rejected. I'm
surprised PG claims they work on iPad; because of this issue, the app
won't be considered to support enough orientations to be accepted. If
you're a portrait-only app then you must also support
PortraitUpsideDown.

N

Jaredx2

unread,
Jun 21, 2010, 11:15:42 AM6/21/10
to phonegap
This really is a problem with Universal Apps not with iPad or iPhone
only apps.

on an iPhone app its Default.png

on an iPad app you can create ones for every orientation - and you
don't need PortaitUpsideDown unless you WANT PortaitUpsideDown just
having a Portrait and a Landscape is enough
(and it does work regardless of orientation).
If on an iPad app you don't have a Default.png then you are golden (as
long as you have the others).
This is how my iPad only PennyDodge program works.
http://itunes.apple.com/us/app/penny-dodge/id376134870?mt=8

The problems I have face is in my Universal App - first it flashes the
iPad screen and then then Default.png.
IF the Default.png is small (ie for the iPhone) then it flashes BIG
then SMALL.
IF the Default.png is but (ie for theiPad) then the phone shows only a
portion of the screen (which is bad).
This is the case with my FREE Universal App MowIt[Lite]
http://itunes.apple.com/us/app/mow-it-lite/id375264705?mt=8

So yes its a problem - but not a deal breaker for us or for Apple.

Nate H.

unread,
Jun 24, 2010, 12:49:06 PM6/24/10
to Jaredx2, phonegap
If the flash that's small is upside down apple might reject the app. I'm surprised that you weren't, but my non-PhoneGap game had a bug fix update that was rejected for just this. Ideally PG would draw the right orientation (and size) while waiting for the WebView to load. I wrote this code myself, but I'm not sure how to contribute back to PG?

- N


--
You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en

For more info on PhoneGap or to download the code go to www.phonegap.com

Gazzer

unread,
Jul 2, 2010, 1:14:38 AM7/2/10
to phonegap
Yeah, it would be a shame to have to submit 2 different applications
to the app store simply for this issue. One way round it might be to
submit it as an iPhone app (but it works as an iPad app anyway) but of
course this would affect your iPad sales. It's unfortunate that such a
minor issue may mean that you cannot use Phonegap to develop iPad/
iPhone apps.

One solution may be here. I couldn't get it to work but others may
have more luck:

http://stackoverflow.com/questions/2791449/phonegap-ipad-lauch-screen-does-not-fit

"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.
http://developer.apple.com/iphone/library/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html
"

If someone is successful using the above, it would be great if you
could post here.

Thanks.

radu

unread,
Jul 16, 2010, 10:29:47 AM7/16/10
to phonegap
I've ran into this problem too and can't fix it. Anybody had any
success with this?

Michele

unread,
Aug 4, 2010, 2:26:28 AM8/4/10
to phonegap
I am also havinmg this issue and can't fix it, can anyone help? please

thanks, mish

delasare

unread,
Aug 4, 2010, 8:29:28 AM8/4/10
to phonegap
Add me to the list of people having this issue. It only happens when
the app is set to be iPhone/iPad Universal.

It would be helpful if someone could at least point out where the
second splash screen is coming from. I'm not that much of an Objective-
C person, but if someone could point me to the right place I can try
to come up with some sort of fix.

If your app is iPad only the easiest fix is to just make the
Default.png file the same size as Default-Portrait.png.

Frank

unread,
Aug 4, 2010, 5:19:17 PM8/4/10
to phonegap

Michele

unread,
Aug 4, 2010, 9:57:28 PM8/4/10
to phonegap
Thanks Frank,
I have tried adding the code in and it worked fine as long you only
have a Default-Portrait.png (for iPad) and a portrait view. As soon as
you have a start image for Landscape (iPad) it all falls apart, it
overides the Default-Landscape.png and forces the Default-Portrait.png
and then flashes Default.png (the one for the iPhone)

Any other suggestions anyone please?

Mish

On Aug 5, 7:19 am, Frank <codeking...@googlemail.com> wrote:
> Just follow these Instructions, that worked fine for me:
>
> http://stackoverflow.com/questions/2791449/phonegap-ipad-lauch-screen...

Michele

unread,
Aug 6, 2010, 12:53:40 AM8/6/10
to phonegap
I have fixed what was wrong with my project, some other javascript I
had in the www folder must have been interfering somehow as when i
have a plain index page with minimal javascript linking to a contents
page where all my other javascript is linked to that page - the
problem does not seem to be there.

Maybe this will help others

mish

Michele

unread,
Aug 6, 2010, 2:00:05 AM8/6/10
to phonegap
I spoke too soon! It is not fixed and the exact same thing happens
when i test the template built from scratch, just because the default
screens are white it is harder to see, but it happens there as well.

:(

Giacomo Balli

unread,
Aug 6, 2010, 8:25:19 AM8/6/10
to phonegap
the solution is editing the location of the file that is displayed on
top of your webview while it loads.

Michele

unread,
Aug 7, 2010, 1:05:50 AM8/7/10
to phonegap
HI Giacomo,
Thanks for your reply, can you explain a bit more what you mean? I am
desperate for a solution

Thanks, mish

Giacomo Balli

unread,
Aug 7, 2010, 4:44:04 PM8/7/10
to phonegap
i tried several things but this seemed to work in PhoneGapDelegate.m
/*
* imageView - is the Default loading screen, it stay up until the
app and UIWebView (WebKit) has completly loaded.
* You can change this image by swapping out the Default.png file
within the resource folder.
*/
//UIImage* image = [[UIImage alloc] initWithContentsOfFile:[[NSBundle
mainBundle] pathForResource:@"Default-Portrait" ofType:@"png"]];
NSString* splashozzo;

BOOL iPad = NO;
#ifdef UI_USER_INTERFACE_IDIOM
iPad = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad);
#endif
if (iPad) {
splashozzo=@"Default-Portrait.png";
NSLog(@"Default-Portrait.png");
} else {
splashozzo=@"Default.png";
NSLog(@"Default.png");
}

UIImage *image = [UIImage imageNamed:splashozzo];
imageView = [[UIImageView alloc] initWithImage:image];
[image release];
imageView.frame = [[UIScreen mainScreen] applicationFrame];
imageView.tag = 1;
[window addSubview:imageView];
[imageView release];

radu

unread,
Aug 9, 2010, 5:37:43 AM8/9/10
to phonegap
Lots of us don't know Obj-C. So could you please explain exactly where
this piece of code would go?

I have v0.9.1, but the only PhoneGapDelegate.m file is in username/
Documents/PhoneGapLib/Classes/PhoneGapDelegate.m. Is this the file
that has to be modified?

There's a link above with a fix:
http://stackoverflow.com/questions/2791449/phonegap-ipad-lauch-screen-does-not-fit/3165038#3165038
That involves modifying Classes/YourApplicationAppDelegate.m. Would we
have to apply that and also apply your patch?

Giacomo Balli

unread,
Aug 9, 2010, 8:17:39 AM8/9/10
to radu, phonegap
In your project (inside Xcode) locate PhoneGapLib.xcodeproj (should be in the middle of the tree with a blue icon).
double click on it. a new window opens. locate PhoneGapDelegate.m and make the changes we were talking about. Close the newly opened window, clean and build again.

hope it helps,
G

Sean Gilligan

unread,
Aug 9, 2010, 6:23:49 PM8/9/10
to phonegap
I tried a mixture of Giacomo's code and the code from StackOverflow,
but it didn't seem to handle all the different orientation cases. I
wanted my startup image to have the same orientation as the initial
UIWebView screen.

I hacked together a solution that uses device.orientation (which only
works on the real device, not on the simulator) to select between
Portrait and Landscape images and to rotate the image as necessary.

I'm a PhoneGap newbie and I've only briefly tested this on a single
device, so I'm not sure how good of a solution this is. Not working
on the Simulator should raise a few eyebrows, at least. Anyway, it
may help someone, so here's the code:

http://github.com/msgilligan/phonegap-iphone/commit/d3fa03940cbc73ef16b32b93b3b69f95dc738ac9


Michele

unread,
Aug 10, 2010, 7:04:50 AM8/10/10
to phonegap
Thanks to everyone helping with this problem
Giacomo can you please clear up where in PhoneGapDelegate.m we add
your code as I am not sure where to change/add yours and so far have
not managed to get it to work, I created 13 errors as I just put it in
at the end - obviously wrong - do I also have to add the code from
stack overview?

thanks, mish
> http://github.com/msgilligan/phonegap-iphone/commit/d3fa03940cbc73ef1...

Giacomo Balli

unread,
Aug 10, 2010, 8:07:13 AM8/10/10
to phonegap
I havent tried Sean's code but it appears more complete since it
accounts for the different possible orientations on iPad; mine was
just the code I used for a specific app.
However, you should not add the code but replace the current code in
the file.
In detail this should occur around line 181. replace from where it
says "* imageView - is the Default loading screen," to "[imageView
release];".

hope it's clear.

talk soon,
G

Michele

unread,
Aug 10, 2010, 6:34:37 PM8/10/10
to phonegap
Thank you all so much, it works just replacing Sean's/Giacomos code
mix into the PhoneGapDelegate.m using the code from the github link in
Sean's post. Now at last I can submit my app as that was the only
thing holding me back

mish

Giacomo Balli

unread,
Aug 11, 2010, 7:44:40 AM8/11/10
to phonegap
glad it helped, let us know when it gets approved!
Message has been deleted
Message has been deleted
Message has been deleted

Michele

unread,
Aug 11, 2010, 6:57:15 PM8/11/10
to phonegap
To make a Universal app I am using the project called xxx-
iPad.xcodeproj. You then need to go into Project/Edit project Settings
and the Build tab. There I choose base SDK 4.0 and further down
Targeted Device Family iPhone/iPad and iPhone Deployment target 3.1

Apple have some recommendations on image naming so I changed that and
added to the plist
Make sure you go to Project/Add to project to include them if you add/
change things

Launch image
Default.png

UILaunchImageFiles
Default-Portrait.png and Default-Landscape.png


I also have the following in the Plist to cover iPad and iPhone 3 and
4
Supported interface orientations (iPad)
AS WELL AS Supported interface orientations (this is for iPhone)

Icon File
iPhoneAppIcon.png

Icon Files
iPhone...@2x.png
iPadAppIcon.png
iPhoneAppIcon.png
Icon-Small-50.png
Icon-Small.png


I do get errors when I build as phonegap has some depreciated code
when you use Base SDK 4.0

Hope this helps, its what I am doing and I have submitted an App with
the errors when I build as it still all seems to work OK

Mish

On Aug 11, 10:46 pm, radu <radu.co...@psrk.com> wrote:
> I noticed also that the app icon is always icon.png (the small one for
> iPhone), if u install on iPhone or iPad. (even if I have icon-72.png
> on the local folder and set in plist)
> I'm using the default project, without any modifications on plist.
> I'm not using the project-iPad.xcodeproj (that is for iPad ONLY apps
> right?)

radu

unread,
Aug 13, 2010, 5:36:28 AM8/13/10
to phonegap
Thanks Michele.
My problem was the images were not included in Resources. Once I've
done that, everything seems ok.
I'm just wondering what's with that xxx-iPad.xcodeproj. I've built my
universal app using the default xxx.xcodeproj. When I tried to use the
xxx-iPad, I got an error about not been able to compile to this kind
of architecture. Is this supposed to be used for iPad only apps?

SunboX

unread,
Jan 10, 2011, 5:01:23 PM1/10/11
to Michele, phon...@googlegroups.com
I´ve fixed it on my github, you can fork it from there:

https://github.com/SunboX/phonegap-iphone/commit/0cd0782652125a0d3bc71ee34ce849be0c0fc35b

greetings André

On Aug 11 2010, 11:57 pm, Michele <mich...@art2day.com.au> wrote:
> To make a Universal app I am using the project called xxx-iPad.xcodeproj. You then need to go into Project/Edit project Settings


> and the Build tab. There I choose base SDK 4.0 and further down

> Targeted Device Family iPhone/iPadand iPhone Deployment target 3.1
>
> Apple have some recommendations onimagenaming so I changed that and


> added to the plist
> Make sure you go to Project/Add to project to include them if you add/
> change things
>
> Launchimage
> Default.png
>
> UILaunchImageFiles
> Default-Portrait.png and Default-Landscape.png
>

> I also have the following in the Plist to coveriPadand iPhone 3 and


> 4
> Supported interface orientations (iPad)
> AS WELL AS Supported interface orientations (this is for iPhone)
>
> Icon File
> iPhoneAppIcon.png
>
> Icon Files

> iPhoneAppI...@2x.png


> iPadAppIcon.png
> iPhoneAppIcon.png
> Icon-Small-50.png
> Icon-Small.png
>
> I do get errors when I build as  phonegap  has some depreciated code
> when you use Base SDK 4.0
>
> Hope this helps, its what I am doing and I have submitted an App with
> the errors when I build as it still all seems to work OK
>
> Mish
>
> On Aug 11, 10:46 pm, radu <radu.co...@psrk.com> wrote:
>
>
>
>
>
>
>
> > I noticed also that the app icon is always icon.png (the small one for

> > iPhone), if u install on iPhone oriPad. (even if I have icon-72.png

Dirk Zimmermann

unread,
Mar 10, 2011, 10:33:56 AM3/10/11
to phonegap
I just posted my fork on https://github.com/dirkz/phonegap-iphone

It gives you the option of providing a boolean key named
'SuppressSplashScreen' in PhoneGap.plist. Set to YES to suppress any
PhoneGap interference with splash screens and leave that to iOS.

The commit is here: https://github.com/dirkz/phonegap-iphone/commit/9f8a256257cd93a469feb498180df4317a7b658d

// Dirk

Matthias

unread,
Apr 28, 2011, 6:52:43 AM4/28/11
to phonegap
I used the code from Giacomo etc., thanks guys! But now the portrait
splash shows up for a split second between the landscape splash and
the app itself (when loading a iphone AND ipad app on the ipad in
landscape mode). How come?

On 10 Mrz., 17:33, Dirk Zimmermann <m...@dirkz.com> wrote:
> I just posted my fork onhttps://github.com/dirkz/phonegap-iphone
>
> It gives you the option of providing a boolean key named
> 'SuppressSplashScreen' in PhoneGap.plist. Set to YES to suppress any
> PhoneGap interference withsplashscreens and leave that to iOS.
>
> The commit is here:https://github.com/dirkz/phonegap-iphone/commit/9f8a256257cd93a469feb...
>
> // Dirk

phil404

unread,
Apr 28, 2011, 1:24:40 PM4/28/11
to phon...@googlegroups.com
This is great, Dirk. I hope this makes it into a future core release.

Giacomo Balli

unread,
Apr 28, 2011, 2:41:55 PM4/28/11
to phonegap
using latest phonegap?

jwightman

unread,
May 23, 2011, 8:50:03 PM5/23/11
to phon...@googlegroups.com
This is exactly the fix I need.....

However, as a total newbie to Phonegap and XCode I can't seem to make it work.  What am I doing wrong?

First I copy the fork code into my AppDelegate.m file, then I add SuppressSplashScreen to the plist. 

However, when I Build and Run it says
 "settings" undeclared here (not in a function)
Expected identifier of "(" before "if"
Reply all
Reply to author
Forward
0 new messages