iPhone X notch in screen

I just watched the Apple keynote that launched the iPhone X. It appeared that app content flows around the notch (and video has a bit missing for the notch). It looks like it could be an issue if you have GUI elements across the top of the screen (as I do). Are they going to go missing in the notch?

Maybe we’ll have to custom design our UI’s to account for it and the rounded corners.

You’ll also need to consider the area at the bottom of the screen for the home screen gesture indicator in both portrait and landscape orientations. Apple has posted Human Interface Guidelines for iPhone X, which recommends adapting your app’s UI to a ā€œsafe areaā€ on the screen.

Pre-existing apps will have black bars in non-safe parts of the screen.
You will have to rebuild with new Xcode and re-submit it to the app store to get access to full screen. You should be able to experiment with that in Simulator.

2 Likes

So I’m going to have to layout the top of the screen differently to account for this device, and it looks like I will have to totally change my game at the bottom because you drag pieces from near the bottom.

There go all the screen-corner-pixel hidden debug menus :slight_smile:

2 Likes

It would be great if Unity added an Player Setting option to clip the screen rect to exclude the ā€œhornsā€ on the iPhone X.

A quick and dirty manual fix for landscape only apps is to edit the UnityAppController.mm file in the Xcode project, replace the line:

    _window = [[UIWindow alloc] initWithFrame: [UIScreen mainScreen].bounds];

with:

    CGRect winSize = [UIScreen mainScreen].bounds;
    if (winSize.size.width/winSize.size.height > 2) {
        winSize.size.width -= 32;
        winSize.origin.x = 32;
    }
    _window = [[UIWindow alloc] initWithFrame: winSize];

Although this does misalign the splash screen and first scene, which might be an issue for some.

3 Likes

Yeah… although… they didn’t really bother when they showed examples in the keynote.

3219160--246690--clipping.jpg

5 Likes

That is a good idea. It would save tons of developer’s time tweaking their UI’s just for iPhone X.

It’s not just the horns (we can live with the status bar in our portrait view), but the swipe indicator as well.
Watching the video explains the problems.

What we really need is a way for Unity to feed us the ā€œSafe Areaā€ of the screen via an API call that we can then set RectTransforms in the UI to and do our best to try to accommodate the spacing as best we can in the app. Apple… I love you and hate you. I REALLY hate that swipe indicator overlapping all of my applications. I really wish they would have just put the home button on the side.

1 Like

I wonder what happens to the status bar in landscape orientation.

I do too, based on what I’ve been able to find out, there no longer is a landscape status bar in the iPhone X simulator.

What aspect ratio will the safe area be for existing apps? 16:9?

and will it be the same aspect ratio in portrait and landscape? Or will it change like this…

The notch on the iPhone X has been the subject of a great deal of debate even before the keynote.

Maybe use those ā€œnotch sidesā€ to place UI elements like a pause button or something else?

@Mantas-Puida Can you tell me the aspect ratio of the safe area for existing Unity apps please?

1 Like

Hi all … if this is helpful to anyone, I’ve been able to work out the exact pixel values for the safe area for iPhone X using Xcode 9.0, assuming you don’t use native UI Kit views. So this is for landscape orientation:

iPhone X overall dimensions
2436 x 1125 pixels

Overall safe area
2172 x 1062 pixels

Left & right insets (accounts for the notch and curved corners, plus a margin)
132 pixels each

Bottom inset (accounts for the bottom nav bar)
63 pixels

Top inset
zero pixels

8 Likes

using my previous post you could work out the ratio from that.

Hi @Mantas-Puida =) I was just wondering if you know roughly when the device generation enum might be updated with the latest iPhone models, particularly the X to help make X only UI tweaks. I can pipe in my own detection if need be, but if it’s expected in an upcoming patch version that’d be great to know, thanks! =)