美文网首页
iOS 适配各机型启动页LaunchScreen.storybo

iOS 适配各机型启动页LaunchScreen.storybo

作者: 橙_知足常乐 | 来源:发表于2021-08-02 16:51 被阅读0次

    图片适配

    1.选择Assets.xcassets—>左下角+号—>New Image Set.然后自己命一个名字

    2.修改图片的Contents.json文件,修改内容如下(双击图片,选择Show in Finder,文件夹里面有一个Contents.json文件,双击打开)

    {"images":[{"idiom":"iphone","scale":"1x"},{"idiom":"iphone","scale":"2x"},{"idiom":"iphone","scale":"3x"},{"idiom":"iphone","scale":"1x","subtype":"retina4"},{"idiom":"iphone","scale":"2x","subtype":"retina4"},{"idiom":"iphone","scale":"3x","subtype":"retina4"},{"idiom":"iphone","scale":"3x","subtype":"736h"},{"idiom":"iphone","scale":"2x","subtype":"667h"},{"idiom":"iphone","scale":"3x","subtype":"2436h"},{"idiom":"iphone","scale":"3x","subtype":"2688h"},{"idiom":"iphone","scale":"2x","subtype":"1792h"}],"info":{"author":"xcode","version":1}}

    3.此时就可以根据不同屏幕适配不同的启动图了

    4.适配完各个屏幕图片后,去LaunchScreen.storyboard搭建启动图

    相关文章

      网友评论

          本文标题:iOS 适配各机型启动页LaunchScreen.storybo

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