在我們應用開發中,用戶在手機上點開我們的應用,從手指點擊到我們的應用圖標到我們的應用真正啟動是需要一段時間的,隨著開發的推進,有可能會把這個時間變得比較長,這個時候我們就需要有一個占位圖來在用戶點擊了我們的應用之后馬上顯示出來給用戶看。這個東西就是 LaunchImage
。
如何使用
添加 LaunchImage
很簡單,只需要在圖片文件夾Images.xcassets
中點擊 +
,然后選擇App Icons & Launch Images
然后選擇 New iOS Launch Image
就可以了。
addLuanchImage.png
尺寸大小
添加了之后我們就會看到一大堆等著我們填充的位置,這么多位置,看著真是不知道要寫填什么尺寸好。
showLuanchImage.png
那么下邊我就把每個位置對應的圖片尺寸寫下來。
iPhone Portrait iOS 5,6
- 1x : 320*480
- 2x : 640*960
- Retina : 640*1136
iPad Protrait Without Status Bar iOS 5,6
- 1x : 768*1004
- 2x : 1536*2008
iPad Portrait
- 1x : 768*1024
- 2x : 1536*2048
iPad Landscape Without Status Bar iOS 5,6
- 1x : 1024*748
- 2x : 2048*1496
iPad Landscape iOS 5,6
- 1x : 1024*768
- 2x : 2048 * 1536
iPhone Protrait iOS 8,9
- Retina HD 5.5'' : 1242*2208
- Retina HD 4.7'' : 750*1334
iPhone Landscape iOS 8,9
- Retina HD 5.5'' : 2208 * 1242
iPhone Portrait iOS 7-9
- 2x : 640*960
- Retina4 : 640*1136
iPad Portrait iOS 7-9
- 1x : 768*1024
- 2x : 1536*2048
iPad Landscape iOS 7-9
- 1x : 1024*768
- 2x : 2048*1536
這樣設置好了之后,我們的應用在啟動時就會顯示對應的啟動圖片了。