【iOS开发】使用Xcode8 添加Launch Image(启动图片)之001

来源:互联网 发布:网络视频自己组装枪支 编辑:程序博客网 时间:2024/06/05 15:26

一、Assets.xcassets -> + -> App icons & Launch Images -> New iOS Launch Image

这里写图片描述


二、设置为Launch Image的图片,最好为 .png格式

这里写图片描述


三、单击工程名称 -> General -> Launch Images Source改为LaunchImage ->Launch Source File的内容置为空

这里写图片描述


四、将LaunchScreen.storyboard的设置中的Use as Launch Screen取消

这里写图片描述


五、此时运行就能看到Launch Image了,记得把之前装的app卸载掉。


六、效果图(ipad && iphone)

iPad 启动页面

这里写图片描述

iPhone 启动页面

这里写图片描述


七、如果感觉Launch Image显示的时间太短,可以在AppDelegate.m文件里面添加一行 延迟 代码:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{    // 延迟进入应用,避免应用启动过快,导致启动图片一闪而过    [NSThread sleepForTimeInterval:3.0];}

八、设备支持的启动图片尺寸大全

按照如下 设置Launch Image 尺寸

Device Orientation&&System Size Launch Image pixel iPhone Portrait iOS 5,6 Retina 4 LaunchImage@2x.png 640 × 1136 pixels iPhone Portrait iOS 7,8 Retina 4 LaunchImage@2x.png 640 × 1136 pixels iPhone Portrait iOS 8 Retina HD 5.5 LaunchImage@3x.png 1242 × 2208 pixels iPhone Portrait iOS 8 Retina HD 4.7 LaunchImage@2x.png 750 × 1334 pixels iPhone Portrait iOS 5,6 1x LaunchImage.png 320 × 480 pixels iPhone Portrait iOS 5,6 2x LaunchImage@2x.png 640 × 960 pixels iPhone Portrait iOS 7,8 2x LaunchImage@2x.png 640 × 960 pixels iPhone Landscape iOS 8 Retina HD 5.5 LaunchImage@3x.png 2208 × 1242 pixels iPad Portrait iOS 7,8 1x LaunchImage.png 768 × 1024 pixels iPad Portrait iOS 7,8 2x LaunchImage@2x.png 1536 × 2048 pixels iPad Landscape iOS 7,8 1x LaunchImage.png 1024 × 768 pixels iPad Landscape iOS 7,8 2x LaunchImage@2x.png 1536 × 2048 pixels

下一篇:launch Images启动图片设置(UILaunchImageFile)之002

4 0