135

Running my App in the iPhone X Simulator (GM Seed) I am noticing two strange effects:

  • the App does not use the full screen space (top and bottom area is black)
  • a strange white bar beneath the title bar

enter image description here

Does anybody know what is happening here and how to resolve this? I can't find any new settings in Interface Builder.

Paolo Forgia
  • 5,804
  • 7
  • 39
  • 55
Darko
  • 8,619
  • 7
  • 28
  • 42
  • 1
    Are you using a Launch Screen file or launch images? Are you using auto layout? – rmaddy Sep 12 '17 at 20:38
  • 1
    Launch images and auto layout – Darko Sep 12 '17 at 20:38
  • 3
    Why are you using the old style launch images instead of the much easier Launch Screen file? Anyway, have you added the new launch image needed for the new screen size? – rmaddy Sep 12 '17 at 20:39
  • I can't find a launch image for the iPhone X size. But using a launch screen solved both issues. Please edit your response and I will mark it as answered. Thanks! – Darko Sep 12 '17 at 20:44
  • PS: There is a good reason for using lauch images until now, it's hard to explain. Basically I am extending the showing of the launch image until the initial network load of the initial viewcontroller has finished. To present the user immediately content without a loading indicator. And it worked perfectly until now, I saw no reason to change this. But now I have to change it. – Darko Sep 12 '17 at 20:50
  • I just created a new sample iOS project with Xcode 9GM and there are slots for the iPhone X launch image. You might need to add a new launch image asset to see the new iPhone X slots. – rmaddy Sep 12 '17 at 21:58
  • 5
    You SHOULDN'T USE launch images. USE `Launch Screen.storyboard` instead – onmyway133 Sep 13 '17 at 07:52
  • I use Launch Screen storyboard (UIImageView with AspectFill setting), but I have the same problem with iPhone X. When launching app -> top and bottom are white. – sabiland Sep 17 '17 at 07:31
  • @sabiland Do you use navigation bars? Auto layout? Safe areas? – Darko Sep 17 '17 at 09:26
  • Yes, both. Launch Screen storyboard + UIImageView (AutoLayout pinned to safe-area). I have those black-bar issues only with iPhone X when launching app. After I launch the app everything is ok. – sabiland Sep 18 '17 at 05:32
  • Are you sure the LaunchScreen is really used? Try to add a label and see if the label appears. – Darko Sep 18 '17 at 13:59
  • Yes, I am 100% sure :). Only on iPhone X is the problem when launching app with Launch Screen storyboard. – sabiland Sep 19 '17 at 09:01
  • Have anyone succeeded in using full screen area of iPhoneX with a iOS 10 Base SDK build ? When iPhone 4 was released, using the extra area only required to add a Default-568h.png regardless of the base SDK. – Nikhil Mathew Oct 29 '17 at 01:00
  • Did not try that. But did you try just using a launch screen on the iOS 10 SDK instead of launch images? – Darko Oct 29 '17 at 05:15

10 Answers10

187

When using launch images (instead of the much easier Launch screen file), you need to provide the properly sized launch image for each device size you wish to support. Once you add the additional launch image, your app should take advantage of the new screen size.

The new iPhone X requires a launch image sized at 1125px × 2436px which is a 3x image for 375pt × 812pt.

Of course if you switch over to using a Launch screen file instead of individual launch images, your app will automatically adapt to all device sizes without any additional work.

rmaddy
  • 298,130
  • 40
  • 468
  • 517
  • 2
    can you go into more detail on how to integrate the new iphoneX image into a Launch Screen? Any Image Sets I add to Xcode 9 don't have iphoneX slots, only Launch Image sets. – Christian Cerri Sep 13 '17 at 06:49
  • 1
    @ChristianCerri Image sets are not tied to devices. They just give you 1x, 2x, and 3x options. I was referring to launch images. Those are the only device specific images. If you have a question about adding different sized images to a Launch screen then please post your own question specific to that issue. – rmaddy Sep 13 '17 at 06:52
  • just did as you asked: https://stackoverflow.com/questions/46191522/how-to-add-iphonex-launch-image – Christian Cerri Sep 13 '17 at 08:19
  • 19
    How the hell launch images related to blackbar on top and bottom of iPhone X simulator ??! – TomSawyer Sep 23 '17 at 18:46
  • 1
    @TomSawyer If your app doesn't use a Launch screen storyboard then the launch images determine what screen sizes your app supports. – rmaddy Sep 23 '17 at 18:50
  • It's working only the problem is my navigation bar not show properly. – Mihir Oza Oct 10 '17 at 08:19
  • 1
    See answer from @sabiland if you're still seeing black bars and using a launch screen. Would be great if this answer could be supplemented with the tidbit about how to design the launch screen properly for iPhone X. – Crashalot Nov 09 '17 at 10:03
  • Some of us are working for clients that refuse to adopt the new systems. So sure, I agree, it's much easier and preferable, but we don't all have choice. – mxcl Dec 05 '17 at 00:57
  • @rmaddy, I have a legacy code which uses auto resizing and is built for iPhone 5 and it scales for iPhone 6 and 6 Plus but it doesn't scale for iPhone X and black space is shown on top and bottom of the screen. Could you please tell me if there is a way that scaling can be done on iPhone X or is it not possible to scale the app for iPhone X. – Chirag Bhutani May 24 '18 at 11:07
36

I have figured out this issues in iPhone X. Launch image size (1125*2436px) Please flow this below steps. 1.i)Choose your project name in Xcode. ii)Select your project target iii)Then select Launch images source enter image description here

  1. You can get Migrate popup i) Choose Assets ii)Select Migrate

enter image description here

  1. After that select your Assets.xcassets in your project enter image description here

  2. Then select Launch image in assets i)Then select attribute inspectorenter image description here

  3. finally check your Launch image source. you can see set Launch image.

enter image description here

Karthick C
  • 1,483
  • 17
  • 13
  • Upvoted for the pictures. But you should clear out the "LaunchScreen" Text from the Launch Screen File text field in your last image. – NadtheVlad Oct 28 '17 at 18:51
  • Thank's @NadtheVlad. Please clear the "LaunchScreen" text from Launch Screen File and delete LaunchScreen.Storyboard file from Xcode. – Karthick C Oct 31 '17 at 12:37
  • Thanks! It was landscape checkbox from Launch Image that was causing problem since my app is only portrait. – green0range Jan 04 '18 at 19:20
  • Thank you, had the same issue and resolved it by adding launch images (an SDL2 application) – Viktor Sehr Jun 23 '19 at 21:26
19

iPhone X needs different launch image sized 1125px x 2436px (375pt x 812pt @3x).

enter image description here

Check human interface guidelines for more details.

Lal Krishna
  • 12,476
  • 4
  • 53
  • 65
14

I have figured out how to fix (though I still don't understand why this happened only on iPhone X) LaunchScreen storyboard on iPhone X with seeing black top&bottom bars.

I have LaunchScreen storyboard with one UIImageView.

UIImageView's top&bottom has to be pinned to SuperView's top&bottom. NOT to SafeArea.

sabiland
  • 2,188
  • 1
  • 21
  • 22
  • This solved my problem with LauchScreen with Autolayout. But instead of pin to the borders, I centered horizontally and vertically and equal the width/height to SuperView. – Yuri Natividade Sep 27 '17 at 14:00
  • This only worked after also pinning views in other storyboards to the view top/bottom as opposed to the layout guides. Be sure to check storyboards while in iPhone X mode. – Crashalot Nov 09 '17 at 10:29
  • why i can't see superview in my storyboard when i go to give that constraint – rd_ Oct 08 '18 at 06:44
11

I fixed it by simply inserting some random text in the Lanch Screen File textfield. I dont even have a Launch Screen File... XCode is so buggy.

update

Although this fixes it in simulator (still very weird and unexpected) when uploading a binary to iTunes Connect it will fail due to not finding a LanchScreen file of name "random-name"

Arbitur
  • 36,899
  • 22
  • 86
  • 123
6

Just ran into this while trying to update an app I hadn't worked on in a while.

On Xcode 9.4, I was able to fix this by doing the following:

  1. Add a launch screen by going to File -> New -> File... -> Launch Screen

enter image description here

  1. Make sure the newly added launch screen storyboard is selected as the launch screen file under project settings.

enter image description here

Myxtic
  • 5,509
  • 5
  • 43
  • 68
1

If you already have a 1125px × 2436px launch image but the app is still not using the full screen check to make sure that your image is PNG.

Blago
  • 4,471
  • 2
  • 30
  • 26
1

if you removed LaunchScreen.storyboard; Choose your project, select your project target, General -> App Icons and Launch Images -> Launch Screen File: Select here Main.storyboard instead of LaunchScreen.storyboard

1

Just had this problem... When I selected the project & the correct target I had a blank for the 'launch screen file' under the app icons and launch screen images tab. I set it to the default LaunchScreen and the resizing issue I faced was taken care of.

0

You may check in project target launch screen file is not set to empty if it is empty it may cause problem.enter image description here

Aqib Zareen
  • 91
  • 1
  • 7