Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retina tiled background for Launch Screen.nib

I'm trying out the new funky Launch Screen.xib (storyboard) instead of using launcher images in my iOS app.

On my first page I have a tiled background image called [email protected] which I put on the background of that first page via code:

self.view.backgroundColor = [UIColor colorWithPatternImage: [UIImage imageNamed:@"bodybg.png"]];

So I could do with having the same background on the Launch Screen. Presumably there's no way to execute code when the Launch Screen.xib is loaded, so how do I go about putting a tiled, retina background on a Launch Screen.xib?

like image 666
Matt Parkins Avatar asked Oct 28 '14 16:10

Matt Parkins


People also ask

How do I add Launch Screen in Swift?

Adding a Launch Screen plist file. After opening the file, you should see an entry named Launch Screen. Click the arrow on its left to change the direction. Then click the + button to add a new entry.

What is Launch Screen storyboard?

The LaunchScreen. storyboard is an interface builder storyboard file that uses auto-layout and some basic constraints on the controls to adjust the display for all the supported devices. Perform this task in the copy of the DeploymentKitApp in Xcode on your computer.


1 Answers

  1. Add the image to an asset catalog.
  2. Choose Editor > Show Slicing.
  3. Change slicing configurations as the following (100x100 image is used here): Slicing configuration (This tells Xcode that there are no fixed parts and the entire image should be tiled).
  4. Add UIImageView to your launch screen and use the previous image. Set the mode to Scale to Fill and the image will be tiled to fill the image view.
like image 195
Hejazi Avatar answered Sep 20 '22 16:09

Hejazi