Display default image for splash screen using Monotouch and XCode

Update: The images group this post mentions is technically not necessary and is really just for organization as Xcode puts the physical file at the root. Within MonoDevelop however, including a folder called images will be persisted (which is why this didn’t work when I tried it from MonoDevelop). To make it work from MonoDevelop, simply include the Default.png in the root of your project and give it a Build Action of Content. Thanks to Michael Hutchinson for clarifying this.

Many iphone apps display a startup image when loading rather than an empty black screen. In Xcode this works by having a file named Default.png in an Images group. I couldn’t find a way to do this directly in MonoDevelop yet, but since MonoDevelop supports emitting an Xcode project, we can use this to take advantage of any features that Xcode offers, such as this.

First, in MonoDevelop select Debug in Xcode. This will create an Xcode project under the Debug directory.

Next, open the Xcode project and add a new group called Images.

After this simply add an image file named Default.png.

I tested this on the device and it worked well. If anyone knows a way to do this directly from MonoDevelop please let me know.

6 thoughts on “Display default image for splash screen using Monotouch and XCode

  1. Pingback: MonoTouch.Info
  2. I am trying to implement a background image on a UIView and I am not having any luck. The image is at the root of the solution and I have wired up the image using the UIImage.FromFile(); Any suggestions?

    • Did you set the image’s build action to content? If you email the monotouch list with a code sample I’ll take a look. Cheers.

  3. if you place Default.png in the root of your application with Build action: Content, then the iPhone will automatically display this while the application loads (rather than the “black screen”).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s