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.
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
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.
Yeah⦠although⦠they didnāt really bother when they showed examples in the keynote.
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.
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?
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?
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
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! =)