Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone Splash: "Default.png" displays on simulator but not the iPhone

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!

like image 208
WoodenKitty Avatar asked Feb 10 '10 01:02

WoodenKitty


2 Answers

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.

like image 59
Allisone Avatar answered Nov 13 '22 12:11

Allisone


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.

like image 20
Lachlan Roche Avatar answered Nov 13 '22 11:11

Lachlan Roche