美文网首页
xcode11 启动页适配(多机型适配)

xcode11 启动页适配(多机型适配)

作者: 香烟不灭 | 来源:发表于2020-08-24 11:34 被阅读0次

xcode11废弃了 asset里的 Launch Images Source 所以这种配置启动页的方法就不能用了。苹果强制要求使用Launch Screen.storyboard来适配启动页。

1.创建Launch Screen.storyboard

创建后里面添加一张全屏图片

2.给asset里添加一张图片,然后show in finder 把Contents.json 的东西替换成

{

  "images" : [

    {

      "idiom" : "iphone",

      "scale" : "1x"

    },

    {

      "idiom" : "iphone",

      "scale" : "2x"

    },

    {

      "idiom" : "iphone",

      "scale" : "3x"

    },

    {

      "idiom" : "iphone",

      "filename" : "640.png",

      "subtype" : "retina4",

      "scale" : "1x"

    },

    {

      "idiom" : "iphone",

      "filename" : "640_960.png",

      "subtype" : "retina4",

      "scale" : "2x"

    },

    {

      "idiom" : "iphone",

      "subtype" : "retina4",

      "scale" : "3x"

    },

    {

      "idiom" : "iphone",

      "filename" : "1242.png",

      "subtype" : "736h",

      "scale" : "3x"

    },

    {

      "idiom" : "iphone",

      "filename" : "750.png",

      "subtype" : "667h",

      "scale" : "2x"

    },

    {

      "idiom" : "iphone",

      "filename" : "1125_2436.png",

      "subtype" : "2436h",

      "scale" : "3x"

    },

    {

      "idiom" : "iphone",

      "filename" : "1242_2688.png",

      "subtype" : "2688h",

      "scale" : "3x"

    },

    {

      "idiom" : "iphone",

      "filename" : "828_1792.png",

      "subtype" : "1792h",

      "scale" : "2x"

    }

  ],

  "info" : {

    "version" : 1,

    "author" : "xcode"

  }

}

3.把相应的图片添加上。如

4.GeneRal  ->  Launch Screen File 选择创建的Launch Screen StoryBoad

5.在 targets中 buildsetting下 删除 Launch screen interface file base name 里的东西(双击 删除)。

6.删掉APP,重新运行 就可以了。

相关文章

网友评论

      本文标题:xcode11 启动页适配(多机型适配)

      本文链接:https://www.haomeiwen.com/subject/pkzgjktx.html