How can I make an iPhone launch image easily? How can I make an iPhone launch image easily? xcode xcode

How can I make an iPhone launch image easily?


It would not be much of a problem, do compose a static XIB file of your main screen (empty tab bar, empty navigation bar) or whatsoever. Just the backgrounds without any elements or labels placed on them.

You can launch this "empty" application in the iPhone Simulator which has a built-in screenshot function. With additional software like the iPhone Simulator Cropper you can crop the image to the preferred size.

That would be my approach to do this.


Since I find it cumbersome to remove content in the nib file I use a code approach.

The code is different for each project. But you'll get the idea.

// uncomment to take a screenshot for the launch image//#define SCREENSHOTMODE - (void)viewDidLoad {    [super viewDidLoad];    /* regular stuff */#ifdef SCREENSHOTMODE        self.navigationItem.leftBarButtonItem = nil;        self.navigationItem.rightBarButtonItem = nil;        self.title = nil;        [self deactivateContentForSubviewsInView:self.view];#endif}#ifdef SCREENSHOTMODE- (void)deactivateContentForSubviewsInView:(UIView *)contentView {    for (UIView *aView in contentView.subviews) {        if ([aView isKindOfClass:[UILabel class]]) {            [(UILabel *)aView setText:nil];        }        else if ([aView isKindOfClass:[UITableView class]]) {            [(UITableView *)aView setDataSource:nil];        }        else if ([aView isKindOfClass:[UIToolbar class]]) {            [(UIToolbar *)aView setItems:nil];        }        else if ([aView isKindOfClass:[UIImageView class]]) {            [(UIImageView *)aView setImage:nil];        }        else if ([aView isKindOfClass:[UIView class]]) {            // i often put views in UIViews to group them            [self deactivateContentForSubviewsInView:aView];        }    }}#endif

If you only have a handful of objects you can just remove the content of your UI-elements directly. Without loops.


It seems there is no such tool built in Xcode for this. I ended up with a method just like Sebastian Wramba said above with a little difference. I used Xcode 4.2 storyboarding for UI design of my app, here is my steps to do this in Xcode 4.2 storyboard:

  1. Drag an empty view controller from the "Object library" to the storyboard

  2. Add empty navigation bar/table view/tab bar/other components to the new scene above according to your initial screen layout

  3. Click the view controller in the storyboard, in the "Attributes Inspector" of the view controller, there is a checkbox called "Initial Scene: Is Initial View Controller". Check that.

  4. Launch the app in Xcode, your app's initial screen will be set to the one you just created. Take a screenshot and use that as the launch image.

  5. Set the initial scene back to your real initial scene by checking its "Initial Scene" checkbox.

I will still mark Sebastian Wramba's solution as the answer to my question since the general idea is the same, just create a dedicated UI in Xcode for it.