Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Add iPhoneX Launch Image

Using Xcode Version 9.0 (9A235), I am trying to add a Launch Image for iPhoneX at the requested 2436px × 1125px (landscape). Currently I am using a Storyboard and it looks like this:

enter image description here

'launchimage' is an Image View linked to an Image Set:

enter image description here

And the Image Set is as follows:

enter image description here

The only place I get an iPhoneX sized image is in a Launch Image set:

enter image description here

But when I try to select a Launch Image in the Image View on the storyboard it can't be selected:

enter image description here

Any help on how to add the correct sized launch image for iPhoneX or is it back to Launch Images? I would prefer the correct sized image, not a stretched one.

UPDATE:

I would like to explain why I want the image to be exactly the same pixel per pixel. Following the Guidelines in https://developer.apple.com/ios/human-interface-guidelines/icons-and-images/launch-screen/ my launch image is a static version of the first page of the App. If the Launch Image is stretched then there is a noticeable switch from Launch Image to First Page. Which sort of defeats the object of the guidelines. Apple recommend using a storyboard launch, but it seems you can't follow their guidelines if you do. Typical, really.

like image 360
Christian Cerri Avatar asked Sep 13 '17 07:09

Christian Cerri


People also ask

What is a launch image?

The launch image is visible on mobile devices when launching the app for the first time or when restarting the app. The launch image fills the whole screen for a few seconds until the app data loads and the app content is available. This bridges any gap in loading time and provides the user a seamless experience.

How do I add a splash screen to my iOS app?

Use our Simple Table app as an example, you can add a new property called “Launch image” in the SimpleTable-Info.plist and specify the preferred file name (say, MyLaunchImage). The change instructs iOS to pick “MyLaunchImage.png” and “ [email protected] ” as launch image. You can design your own splash screen.

How to set up iPhone X?

How to set up iPhone X. Step 1: Turn on your iPhone X. Press and hold the Side button (Sleep/Wake button) on your iPhone X to turn it on and then you will see "Hello" in many languages. Unlock your iPhone X by pressing the Home button. Choose your language and select your country/region.

How to design your own splash screen in Xcode?

You can design your own splash screen. For testing purpose, you may download the sample splash screens. After preparing the launch image, go back to Xcode and open your Xcode project. Here we’ll continue to use our Simple Table project. Right click the “SimpleTable” project and select “Add Files to SimpleTable”.

What size splash screen images should I prepare for my iPhone?

In order to support both screen resolution of older iPhone models and latest models, you have to prepare two versions of splash screen images of these sizes: 320 x 480 (for iPhone 2G / 3G / 3GS) 640 x 960 (for iPhone 4 / 4S)


2 Answers

If your used the LaunchImage.launchimage for Launch, the solution is (in Xcdoe 9.0):

  1. Select Assets.xcassets, right click on middle pane, select App Icons & launch Images -> New iOS Launch Image . Then move the old LaunchImage.launchimage images to the new one, and add the image size with 1125×2436 px for the iPhoneX. enter image description here enter image description here

  2. Also, you can add the following json object to Contents.json file which on LaunchImage.launchimage folder in your old project。Once Xcode refreshes, just drop in a 1125×2436px image. If you need landscape, you can add another with the orientation.

	{        "extent" : "full-screen",        "idiom" : "iphone",        "subtype" : "2436h",        "minimum-system-version" : "11.0",        "orientation" : "portrait",        "scale" : "3x"      }
like image 182
Stoull Avatar answered Oct 08 '22 00:10

Stoull


To the 2018 lazy devs like me who has an existing project that has an old version of launchimage (with no iPhoneX variant), here's my solution to support iPhone X - this is a shortcut one for you.

  1. Open Assets.xcassets in your Xcode.
  2. Right click in your LanchImage then select Show In Finder.
  3. Open the Contents.json
  4. Paste the follow codes inside your "images" array.
 {   "extent" : "full-screen",   "idiom" : "iphone",   "subtype" : "2436h",   "filename" : "ipxportrait.png",   "minimum-system-version" : "11.0",   "orientation" : "portrait",   "scale" : "3x" }, {   "extent" : "full-screen",   "idiom" : "iphone",   "subtype" : "2436h",   "filename" : "ipxlandscape.png",   "minimum-system-version" : "11.0",   "orientation" : "landscape",   "scale" : "3x" }, 

Replace of course the filename with appropriate images. Voila!

like image 27
Glenn Posadas Avatar answered Oct 08 '22 00:10

Glenn Posadas