How to display launch image
Asked Answered
C

2

8

I'm a very new to iOS. My Xcode version is 7.2.1 and I'm trying to run on iOS9 using Swift. My problem is that I'm very confused with how I should be creating the Launch Screen Image. I found that there are many ways of creating the launch screen images for different version of iOS. Can someone please explain to me how to setup my launch images?

The process I've followed is:

  1. I create Launch Screen.storyboard I create different sizes of launch screen images in Photoshop.
  2. In General tab, Choose Main Interface "Main".
  3. In App icons and launch images> Launch images source "Brand Assets".
  4. I click on the arrow beside of Brand Assets, and then I put different sizes of images. (iPhone- iOS 8,9 , iPad- iOs 7-9 (Portrait and landscape), iPhone portrait).
  5. Launch Screen File is "empty". I didn't choose anything.
  6. After all I run on iPhone 5 simulator. It did not show anything and just black screen appear.

One thing I want to know is that do I need to put a UIImageView in my Launchscreen.storyboard? Isn't it automatically retrieved from the Images.xcassets folder?

Carnivore answered 24/2, 2016 at 5:0 Comment(3)
You either use the LaunchScreen.storyboard, or static images stored in a xcasset prerendered for each devices screens dimensions, not both.Manana
If I use LaunchScreen.storyboard, what should I do to continue?Carnivore
The View Controller inside the LaunchScreen.storyboard is what you will layout. Labels, image views, whatever you need/want. Refer to @NikhilModi's answer to point your project to the storyboard.Manana
T
4

When you start a new project, you get LaunchScreen.storyboard below are the steps you should follow:

  1. Put Image View in the viewcontroller present in the LaunchScreen.storyboard
  2. Use autolayout to adjust the image view as per your need.
  3. Select the imageview, go to attribute inspector and change the image.
  4. Hit run
Trochelminth answered 24/2, 2016 at 5:25 Comment(5)
What image size should I select?Carnivore
I choose one image and run. But it sill shows black screen.Carnivore
does it show image in viewcontroller of launchScreen.stroyboard?Trochelminth
@May did you choose the correct launch screen file in your target? (target > General > App Icons and Launch Images)Volplane
These are exactly the steps I did, but my image view always showed black. I found that I had to rename my images from launchscreen.png to anything else, like launch-screen.png. I have no idea why, but doing so got them to work.Cass
H
4

you can set Launch Screen like this

step 1: Go to Target -> App icon and luanch images

enter image description here

step 2:

enter image description here

step 3: LaunchScreen.storyboard enter image description here

Hemiterpene answered 24/2, 2016 at 12:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.