开发遇到的那些坑-Launch Images

作者: NSL_zerom | 来源:发表于2016-11-21 16:58 被阅读296次

    iOS开发中设置App启动图有两种设置方式,分别为Launch Images Source 和 Launch Screen File,新建项目时Xcode会自动创建LaunchScreen.storyboard且默认使用Launch Screen File的方式展示启动图。

    首先我们创建一个新工程

    nine.jpg

    其次,填写项目相关信息

    ten.jpg

    选择完毕后进入工程

    two.jpeg

    依次选择

    three.jpeg one.jpg

    选择完毕之后点击如下图

    four.jpeg

    依照图中方法新创建LaunchImage

    seven.jpeg

    创建完成后

    five.jpeg

    刚创建完成后进入时如图

    six.jpeg

    根据下图选择,图片格式及尺寸一定不能错

    eight.jpeg

    如果图片格式或者图片尺寸选择错误就会出现下图问题

    启动图变成了拉伸的app图标

    eleven.jpeg

    iOS启动图尺寸

    尺寸说明

    iPhone Portrait iOS 8,9-Retina HD 5.5 (1242×2208) @3x

    iPhone Portrait iOS 8,9-Retina HD 4.7 (750×1334) @2x

    iPhone Portrait iOS 7,9-2x (640×960) @2x

    iPhone Portrait iOS 7,9-Retina 4 (640×1136) @2x

    iPhone Portrait iOS 5,6-1x (320×480) @1x

    iPhone Portrait iOS 5,6-2x (640×960) @2x

    iPhone Portrait iOS 5,6-Retina4 (640×1136) @2x

    如果想修改启动图的展示时间可参照下面代码

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {    
        [NSThread sleepForTimeInterval:1.0]; // 设置启动页面时间
    }
    

    相关文章

      网友评论

      • NSL_zerom:开发中遇到的坑,之前自己查了好多资料都没解决,后来发现是图片格式问题

      本文标题:开发遇到的那些坑-Launch Images

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