iOS adaptation problem The keyboard becomes larger and the entire interface is stretched

I used xcode 9.0 when doing react native. The version is too old, so the startup image has only the following adaptation. For mobile phones after iphone6, the resolution is not enough, the startup image is stretched, and the subsequent interface is drawn according to this ratio Stretched out, and even the keyboard and status bar have become larger.

So you must upgrade xcode to the latest version, and then create a LaunchImage as shown below.

A reference article is attached below http://blog.csdn.net/ozhuimeng123/article/details/78380757

Start

Two ways to set up:

  • LaunchScreen.storyboard

    1. Drag imageView in LaunchScreen.storyboard and set constraints, check Use as launch Screen on the right
    2. Project - General - App Icons and Launch Images option, set the Launch Screen File to the created LaunchScreen.storyboard or LaunchScreen.xib
  • Assets.xcassets

    1. Set LaunchImage
    2. Prepare: 
  • Various sizes of start-up diagrams: 640 × 960, 640 × 1136, 750 × 1334, 1242 × 2208, (2208 × 1242 required for horizontal)
  • iPhone Portrait iOS5,6(1x:320 × 480 pixels, 2x:640 × 960 pixels, Retina 4:640 × 1136 pixels)
  • iPhone Portrait iOS8,9(Retina HD 5.5”:1242 × 2208 pixels, Retina HD 4.7”:750 × 1334 pixels)
  • iPhone Landscape iOS 8,9(Retina HD 5.5”:2208 × 1242 pixels)
  • iPhone Portrait iOS7,9(2x:640 × 960 pixels, Retina 4:640 × 1136 pixels)
  • iPhone X Portrait  iOS 11+ (3x:1125 x 2436 pixels)

configure 

  1. Project - General - App Icons and Launch Images option set Launch Image Source to LaunchImage
  2. Uncheck Use as Launch Screen
  3. Empty path Launch Screen File

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325240322&siteId=291194637