Solution to incorrect screen size of iPhone 12 series projects

The width of the iPhone 12 series is still the old 375 except for the iPhone 12 mini, the width of the 12 and 12 Pro is 390, and the width of the 12 Pro Max is 428.

LaunchScreen Image & LaunchScreen StoryBoard

Apple told us in the previous Apple News that we should no longer use the LaunchScreen Image to set the launch image1 2, please note that Apple stated that it will start on April 30, 2020. So, that is the description before the release of the iPhone 12 series.

Except for the iPhone 12 mini, which has a width of 375, the sizes of the 12 series are different from the previous ones. If you still use the no longer supported LaunchScreen Image method to set the launch image, the screen width obtained in the project will be 12 /The screen on the 12 Pro is 375 (instead of the real 390), and the screen on the 12 Pro Max is 414 (instead of the correct 428)

Xcode12 vs. Xcode11

Xcode11 packaging also fails to obtain the real screen size of the 12 series. Xcode12 packaging + LaunchScreen StoryBoard can perfectly solve the problem of not obtaining the real screen size.

solution

Delete the old LaunchScreen Image method of setting the launch image.

To use the LaunchScreen StoryBoard launch image, you can just build it as a page, which is also very simple.


  1. iOS ↩︎

  2. iPad OS ↩︎

Guess you like

Origin blog.csdn.net/qq_18683985/article/details/112436909