IOS初级:app的启动图像

时间:2023-03-09 15:43:54
IOS初级:app的启动图像

1,准备若干张适合不同设备满屏幕的图像

这里补充说明一下图像的命名方法:

iphone4屏幕 Default@2x.png

iphone5屏幕 Default-568h@2x.png  (568*2即为屏幕高度)

iphone6屏幕 Default-667h@2x.png

iphone6+屏幕 Default-736h@3x.png

2,将图像复制到

 Images.xcassets中
LaunchImage.launchimage文件夹中


3,在porject navigator 中选中 Images.xcassets,再选中LaunchImage,在Unassigned分组中将对应图片拖到2x的虚线方框内。

这样在LaunchImage.launchimaget目录下的Contents.json里就会自动生成这样的json

  "images" : [

    {

      "extent" : "full-screen",

      "idiom" : "iphone",

      "subtype" : "736h",

      "filename" : "Default-667h@2x.png",

      "minimum-system-version" : "8.0",

      "orientation" : "portrait",

      "scale" : "3x"

    },

........

4,删掉默认的启动页面。

project的TAGETS的General标签中App Icons and Launch Images分组中

确认Launch Images Source选中LaunchImages

删掉Launch Screen File 方框内的东西。

project选中LaunchScreen.xib,将右侧面板中Use as Launch Screen 前面的钩去掉。