Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone Xr's notch size in pixels

What is the size (in pixels or points) of the notch of the iPhone Xr and the iPhone Xs Max? I know them for the iPhone X, see "iPhone X Cutout" on https://www.paintcodeapp.com/news/iphone-x-screen-demystified I believe the iPhone Xs has the same dimensions.

I'm trying to make a game that hugs the space right up to the pixel.

like image 282
Luc Bloom Avatar asked Nov 14 '18 14:11

Luc Bloom


People also ask

What is the notch on iPhone XR?

And the other is of course the notch — the single, condensed home for the necessary iPhone tech that must live independently from the display. In that notch you'll find the speaker, front-facing camera, sensors, and Face ID tech like the dot projector.

How tall is iPhone notch?

When the size of the iPhone 13 Pro notch leaked out, the report mentioned that, while it will be shrink in width by a quarter, but will be 5.35mm in height against the 5.3mm notch in the iPhone 12 Pro, on account of the earpiece rearrangement in the top bezel frame.

How many pixels is safe area?

On landscape images, the default safe area is approximately 1750 x 1035 pixels, and on portrait images the default safe area is approximately 874 x 1340 pixels.

How big is an iPhone screen in pixels?

The standard display resolution sizes include: High Definition (HD): 1280 x 720 pixels. Full HD (FHD): 1920 x 1080 pixels. 2K or Quad HD (QHD): 2560 x 1440 pixels.


1 Answers

Via @prabhat-kasera

It's 30 X 209 Pt

I see now what my error was: I was using 30/2436 % of the screen for both phones.

I should use 30/1624 for iPhone Xr and 30/2688 for iPhone Xs Max.

Device-agnostic code:

// Landscape
float screenRatio = 30 * ((float)UIScreen.mainScreen.scale) /
    UIScreen.mainScreen.currentMode.size.width;

// Portrait
float screenRatio = 30 * ((float)UIScreen.mainScreen.scale) /
    UIScreen.mainScreen.currentMode.size.height;
like image 184
Luc Bloom Avatar answered Oct 23 '22 15:10

Luc Bloom