8

I'm trying to give my iPhone a splash screen.

I've placed Default.png in my resources group. When I run the simulator it is displayed as expected, however when I install my application to the iPhone, no splash screen is displayed.

Does anyone know what the cause/solution to this problem is?

Thanks!

nevan king
  • 112,709
  • 45
  • 203
  • 241
WoodenKitty
  • 6,521
  • 8
  • 53
  • 73

9 Answers9

12

If Default.png is not showing up in device, but simulator... then try the following.

  1. Be sure you delete any "default.png", "Default.png", "Default.PNG", etc. that you might have created in several wrong attemps from within XCode and in Finder.
  2. Delete the App on your iPhone/iPod/iPad
  3. In Xcode Build->Clean All Targets
  4. In Finder go to your project and locate the build folder, delete all folders in there.
  5. Create a new Default.png like in the following example:
    • Connect iPhone/iPod to Mac.
    • Start your App on iPhone
    • In XCode launch Organizer (Window->Organizer)
    • Select your connected Device
    • You should see a tab "Screenshots"
    • Push the Capture Button, to make a Screenshot of your App
    • Push "As Default Image..." Button (This will create the Default.png and add it to your project, so that's a really handy thing)
  6. Build and Run again. It should work now

Problems can occur due to wrong format (should be 320 width and 480 height (yes, that means you can see the status bar in your default.png)) or because you might have named the first file default.png (WHICH IS WRONG), which worked in simulator because it seems to be case insensitive but then when it gets copied to iPhone, it won't be found, cause it is case sensitive. So it will still be there in build folder (i think) causing a next correctly named Default.png not to override the old default.png in this iPhone build folder and so it might seem, that you can't fix the problem (cause you see Default.png in project, but in build it's still default.png). At least this is my understanding now (afterwards), since for me it simply didn't want to work even though I tried again and again with different solutions from other people. So from my point of view this different file handling (case/not case sensitive) is a mess that you can solve, by simply cleaning all and everything and trying to generate a new Default.png with the organizer (after everything was cleaned).

If you want a different/modified splash screen. Open the generated Default.png with photoshop/gimp/whatever and edit it.

Allisone
  • 8,434
  • 4
  • 32
  • 54
  • I'm happy that I still get up-votes and that these instructions still help... but if there should be some part out of date, please put a comment in here, so I can update the text (as I have not touched XCode for over a year) – Allisone May 23 '13 at 13:34
10

Make sure your image is 480x320 pixels, and placed in your application at the top level. The frameworks will display this image until your initial view has loaded and is ready for display.

If you are seeing a black background then there is something amiss, however if you are just seeing your app's initial view then be happy you have managed to launch your app and have it ready for use in good time.

If you really, really want the user to to see your splash screen then slow down your launch by adding a delay into your app before you present the initial view

The file name must be Default.png (with a capital D). Also, do a clean/rebuild of the entire project to ensure the most recent version of the file is being included in the project. Check the filename on the filesystem, it may display differently in XCode.

Lachlan Roche
  • 25,678
  • 5
  • 79
  • 77
  • Hey thanks for the response. My image is indeed 320 by 480, and named Default.png with a capital D. It works for the simulator, and I get a black screen on the device. I'm still stumped :( – WoodenKitty Feb 10 '10 at 05:33
  • I have had this problem occur when I had two images of the same name both as resources of the application. It's undefined which will be copied first, and indeed i've had it alternate on me. – bshirley May 31 '13 at 19:05
3

Make sure that is is added into the bundle. To do this, select the image in the XCode left navigation panel, get info on the file, and make sure the checkbox for your target is enabled. Also make sure the file is really a png and not just named that way.

coneybeare
  • 33,113
  • 21
  • 131
  • 183
  • Hey coney. I double checked that the target is ticked, and I made sure that the file is definitely PNG (opened and resaved it as png using Gimp). It still works on the simulator but not the device :( Thanks though. – WoodenKitty Feb 11 '10 at 00:33
3

Just check the spelling ... I think u r using "default.png" instead of "Default.png". just make "d" capital "D" of Default.png .

2

Another possible issue that is Default.png is actually Default.jpg that was renamed to .png. This will work fine on the simulator, but won't work on the device.

tt.Kilew
  • 5,954
  • 2
  • 33
  • 51
2

If you are using an iphone 4 you also need to add a Default@2x.png with the size 640*960 px.
That's what fixed it for me.

This naming convention applies to all images in your app btw.

Kenny
  • 21
  • 1
0

Had the same problem caused by saving the initial file as default.png, so it should be Default.png (normal) and Default@2x.png (retina) images.

Go to your projects plist and add a row "Launch image" - use a different file name. Save your images with this name (and add @2x.png for retina). Should be fine afterwards.

Also, if you've already install the app on device, delete the app from device (as previous installation may not affect the changes).

Hemang
  • 26,840
  • 19
  • 119
  • 186
Mark
  • 1
0

I had a similar problem, but my images were being displayed as gray or gray bars. It turned out that there was an alpha channel on the PNG images that the simulator was having no problem with, but the iphone wouldn't display. I opened the images in preview on my Mac and re-saved them without the alpha channel and everything worked. Don't know if this is your problem, but it might be worth a try.

Ryan
  • 474
  • 1
  • 3
  • 12
  • PS - I had originally created the files in photoshop and saved them as PNGs from there. – Ryan Feb 15 '11 at 03:38
0

I know this is old, but I'm having the exact same issue. The image doesn't show on the device, but is fine on the simulator. I noticed a lot of really weird things with my project, like there were 3-4 "Default.png" images in my plist and that there were a few other "Default.png" images in different libraries and stuff that I didn't notice.

I tried everything to get them to show up, but after creating a new project and setting the launch images to the EXACT same images I was trying to use, they worked fine. The only thing I can think is that somewhere the project gets corrupted and won't figure out what those launch images do.

Heckman
  • 398
  • 1
  • 13