使用Assets.xcassets來管理引導(dǎo)頁(yè)圖片,將指定分辨率的圖片放入指定的位置,使用時(shí)只需要拿到圖片名,圖片會(huì)根據(jù)分辨率自動(dòng)選取匹配的圖片 有點(diǎn)像@2x @3x圖片自動(dòng)管理機(jī)制
具體實(shí)現(xiàn)有以下幾個(gè)步驟:
1.創(chuàng)建一個(gè)LaunchImage類型的圖片集合(右邊工具欄改你只要的尺寸大小,適配橫屏豎屏iOS7之前等尺寸)
2.將創(chuàng)建的LaunchImage.launchimage從命名為后綴名為.imageset的圖片集合introductoryPage1.imageset
3.根據(jù)分辨率將指定圖片拖入到指定位置
4.如有多張圖片引導(dǎo)頁(yè),可以使用同樣方法創(chuàng)建多個(gè)introductoryPage2.imageset,introductoryPage3.imageset,introductoryPage4.imageset等
目前主流適配的設(shè)備尺寸
| 尺寸 | 分辨率 | @ | 型號(hào) | 對(duì)應(yīng)設(shè)備 |
|---|---|---|---|---|
| 4.7'' | 750×1334 | @2x | Retina 4.7'' | iPhone6/iPhone6s/iPhone7/iPhone7s/iPhone8/iPhone8s |
| 5.5'' | 1242×2208 | @3x | Retina 5.5'' | iPhone6P/iPhone7P/iPhone8P |
| 5.8'' | 1125×2436 | @3x | iPhone X/iPhone XS | iPhoneX/iPhoneXs |
| 6.1'' | 828x1792 | @2x | iPhoneXR | iPhoneXR |
| 6.5'' | 1242x2688 | @3x | iPhoneX Max | iPhoneX Max |