LaunchScreen.storyboard not taking full height on iPhone X
Asked Answered
S

3

5

I'm attempting to set up a splash image on a fresh Xcode project but the app and splash screen, regardless of what I change in LaunchScreen.storyboard, will never take the full height of the iPhone X screen. The changes however do take effect so I know it's the right file.

Storyboard settings: Xcode window showing launch screen storyboard

Using it on my icon/launch settings:

Settings for launch screen and app icon

What I see on my phone, keep in mind the status bar is being cut off...maybe this has something to do with it?

Screenshot of launch screen on device

Systematize answered 6/3, 2019 at 19:38 Comment(5)
This has nothing to do with the Swift programming language. Please don't use inappropriate tags.Calif
@Calif It is controllable via swift.Systematize
No it isn't. There is no code associate with a launch screen storyboard. And your question doesn't ask anything about Swift.Calif
It doesn’t look like your launch screen is using safe areas, which are required for iPhone X. On closer inspection it says “opens in latest Xcode (9.0)” which suggests to me you’re not using the right version of Xcode. In any case, your app is being letterboxed by iOS because it thinks you haven’t built against the latest version of the iOS SDK.Demagnetize
You need to add constraints. As of now, the white view simply matches the canvas size in the storyboard (i.e. the size of the iPhone 8). Constrain leading, trailing, top, and bottom edges to the superview.Spoils
S
0

No matter what I tried it would not update. I eventually ended up simply reinstalling xcode 10.1 and it fixed itself. I think something got mixed up because I had 3 versions of xcode installed.

Systematize answered 7/3, 2019 at 16:59 Comment(0)
H
10

A) In case you are making this just from the Storyboard

  1. If you want it full screen and above the safe area, you should definitely use Safe Area and as well set your margins/leading/trailing to superview and not to safe area.

  2. If you would like to respect the safe area, just set your margins/leading/trailing to safe area.

B) In case you are setting your splash screen from Swift programmatically (post the code to have a clear overview of your situation)

  1. If you are creating the view and then attaching it to the window or to the ViewController view, just post some code here as how you are making it.

  2. If you are adding the view (splashscreen) programmatically to a view in your Storyboard, then just adjust the view in the storyboard to have the top/bottom margin (or vertical spacing) related to TOP and BOTTOM of the Superview and not of the Safe Area (In case you want a full screen height).

For more information about Safe Area in newer iPhone: https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/adaptivity-and-layout/

For future I would suggest to change your preview if you are working in storyboard to be View as: iPhone X and not iPhone 8 as your screenshot in order to see in real time your changes. Also post some screenshot of your SplashScreen with the Size Inspector settings.

Homestead answered 6/3, 2019 at 22:21 Comment(0)
S
10

If you previously set Constraints to 0, 0, 0, 0 relative to SafeArea View, go to ViewController on the left enter image description here

and select constraints, one by one. On the right panel, select size inspector: select Second Item and make it relative to Superview.

enter image description here

enter image description here

Sheley answered 28/7, 2021 at 16:7 Comment(1)
If adding constraints to super view doesn't seem to do it, it may help to check the content mode of the image. If it is Aspect Fit the image will not fill the entire height of the screen and it may look like the issue has something to do with safe area.Caleb
S
0

No matter what I tried it would not update. I eventually ended up simply reinstalling xcode 10.1 and it fixed itself. I think something got mixed up because I had 3 versions of xcode installed.

Systematize answered 7/3, 2019 at 16:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.