Quick Fit verdict first, ask the designer for two startup images: iPhone XR: 828px x 1792px iPhone XS Max: 1242px x 2688px

The screen size is used in the code to determine whether the iPhone X needs to be modified, please turn to the last.

Updated on October 22, 2018 with the latest information

The size and resolution of all iPhone devices

There is only iPhone X/iPhone XS in LaunchImage

XCode GM Bug?

In XCode GM, only iPhone X/iPhone XS will appear in the LaunchImage, and iOS 8.0 and Later are not selected. There is no iPhone XR/iPhone XS Max. You need to manually select iOS 8.0 and Later to display the iPhone XR/iPhone XS Max startup image. This may be a Bug in XCode GM.

XCode9 LaunchImage

XCode10 GM LaunchImage iOS 8.0 and Later is not selected

XCode10 GM LaunchImage iOS 8.0 and Later iPhone XR/iPhone XS Max

IPhone XR/XS Max compatibility request for older versions

If the iPhone XR/iPhone XS Max boot image is not set but the iPhone X boot image is set, the iPhone XR/ XS Max will be 375PTX812pt by default. The content will be stretched to the iPhone XR/XS Max screen in an almost equal proportion, as shown below:

IPhone XR and iPhone XS Max Aspect ratio: 896/414 = 2.16425121

IPhone XR/XS Max screen size

model The logical size The coefficient of The resolution of the
iPhone XR 414pt x 896pt @ 2 828px x 1792px
iPhone XS Max 414pt x 896pt @ 3 1242px x 2688px

At the time, the XR 828px resolution was a bit strange, but now it’s not that Apple doesn’t want to make 720 or 1080, it’s that apple wants to help developers. XR and XS Max are pretty uniform in terms of logical size 2x and 3x is enough, and you don’t have to do any other cuts.

So now we just need the designer to give us two renderings:

IPhone XR: 828px x 1792px

iPhone XS Max: 1242px x 2688px

Tips

1. Pay attention to whether it is iPhone X in the code

If you used to judge the iPhone X by the size of the device, you’ll need to change that. The main reason for judging the iPhone X is the bangs, which may require some special treatment. IPhone X/XS/XR/XS Max has a safety distance at the bottom, so you can use safeAreaInsets. Bottom > 0.0 to determine whether it is iPhone X/XS/XR/XS Max.

SafeAreaInsets support iOS11 and later.

static inline BOOL isIPhoneXSeries() { BOOL iPhoneXSeries = NO; if (UIDevice.currentDevice.userInterfaceIdiom ! = UIUserInterfaceIdiomPhone) { return iPhoneXSeries; } if (@available(iOS 11.0, *)) {UIWindow *mainWindow = [[[UIApplication sharedApplication] delegate] window]; If (mainWindow. SafeAreaInsets. Bottom > 0.0) {iPhoneXSeries = YES; } } return iPhoneXSeries; }Copy the code

Reference documentation

Detect if the device is iPhone X “Tech Talks – Session 207”