iOS適配問題 鍵盤變大 整個界面被拉伸

作react native時用了9.0的xcode,版本太老,致使啓動圖只有下面這樣的適配,對於iphone6之後的手機,分辨率是不夠的,啓動圖拉伸了,後面的界面都按這個比例拉伸了,連鍵盤和狀態欄也變大了。react

因此必需要升級xcode到最新版,再建立LaunchImage就會以下所示。xcode

下面附上一個參考的文章http://blog.csdn.net/ozhuimeng123/article/details/78380757iphone

開始

兩種方法設置:

  • LaunchScreen.storyboardui

    1. 在LaunchScreen.storyboard中拖拽imageView並設置約束,勾選右側Use as launch Screen
    2. 工程—General—App Icons and Launch Images選項中設置Launch Screen File爲所製做的LaunchScreen.storyboard或者LaunchScreen.xib
  • Assets.xcassetsspa

    1. 設置LaunchImage
    2. 準備: 
  • 各類尺寸啓動圖:640 × 960,640 × 1136,750 × 1334,1242 × 2208,(橫平須要2208 ×1242)
  • 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)

配置 .net

  1. 工程—General—App Icons and Launch Images選項中設置Launch Image Source 爲LaunchImage
  2. 取消勾選Use as Launch Screen
  3. 置空路徑Launch Screen File
相關文章
相關標籤/搜索