Launch Image does not show up in my iOS App

前端 未结 28 1563
逝去的感伤
逝去的感伤 2020-12-02 04:11

I want to get a simple launch screen to show in my app, built using Xcode 6.0.1.

I have added a launch screen in two ways: As an XIB (with the default name, LaunchSc

相关标签:
28条回答
  • 2020-12-02 04:33

    I've read about a bug in Xcode 6 which prevents landscape only apps from displaying a launch image.

    Try to set images and orientation within Images.xcassets:

    0 讨论(0)
  • 2020-12-02 04:35
    • Make sure your images are accurate size according to Apple guidelines.
    • Make sure, You will select only one option , either launch screen file or Launch Image Source. You can find these two options in Project build settings -> General

    My suggestion to you is to select Launch Image Source as Image.Assets. Create splash image assets there in Image.assests folder.

    Reference image for right configuration:

    0 讨论(0)
  • 2020-12-02 04:36

    So this has been quite painful for something that should be trivial. Here is what I did:

    Use xcassets

    I decided to use .xcassets versus the .xib for launch. I deleted the .xib. If you have images.xcassets already in your project then great, otherwise you can add one from File>New>file:

    AddNewASsetCatalog

    Create a Launch Image Set

    Now create at a minimum a launchimage set and icon set in your .xcassets file by right clicking in the navigator area.

    Add new Launch image and app icon

    Update the App Icons and Launch Images Settings

    Then I made sure that the "Apps icon and image sets" in my target are as below.

    Very Important: Make sure the "Launch screen file" setting is blank.

    Apps icon and image sets

    Add the Images

    Last but not least, the terminology used by Apple for the device selection is confusing. Initially I thought that since I am deploying for iOS8 only (iPhone Portrait), I can do this and just put in the iPhone 6 and iPhone 6+ launch images:

    Devices

    I quickly realized that is not the way this works and I was getting a warning: "An iPhone Retina (4-inch) launch image for iOS 7.0 and later is required."

    So I had to select the iPhone under iOS 7.0 and later as well and add an Image for the iPhone 5s.

    So to find out which boxes to check on the right, do not ask the question: What is my minimum iOS and device and device orientation but rather ask:

    What devices out there can support my minimum iOS? Now What is the minimum iOS supported on those devices? And make sure you check all of those boxes. So for me, I am targeting iPhone 5s, 6 and 6 Plus at 8.0 but given that iPhone 5s can exist with 7.0, I need to check the 7.0 box as well to show the image placeholder. In other words, the (iOS) check box on the right shows you the minimum iOS version available for that device and you need to click it to show the image placeholder and put an image regardless of whether you are deploying at this iOS version or not.

    Hope this helps somebody.

    Adding all devices

    0 讨论(0)
  • 2020-12-02 04:36

    For me, it worked when I uninstalled the app and then restarted the simulator. When installed again, launch image appeared as expected. This also worked on an actual device.

    0 讨论(0)
  • 2020-12-02 04:36

    One way is to also add "Launch Screen" (LaunchScreen.xib), paste the image into UIImageView and then set it to "Horizontal Center in Container" and "Vertical Center in Container" in "Align" if you are using Auto Layout.

    Screen: http://i.stack.imgur.com/CfnHT.png

    Don't forget to put LaunchScreen.xib into "Launch Screen File".

    0 讨论(0)
  • 2020-12-02 04:36

    If you have changed your launch image from a previous image, and observe the following:

    • devices/simulators where the app was previously installed, still show the previous image and refuse to show the new one (uninstalling and reinstalling the app doesn't help)
    • devices/simulators where the app was not previously installed, show the new launch image

    It is likely because of the caching of launch image done by iOS. Rebooting the device should solve the problem.

    0 讨论(0)
提交回复
热议问题