iOS开发中设置App启动图有两种设置方式,分别为Launch Images Source 和 Launch Screen File,新建项目时Xcode会自动创建LaunchScreen.storyboard且默认使用Launch Screen File的方式展示启动图。
首先我们创建一个新工程
其次,填写项目相关信息
选择完毕后进入工程
![](http://img.e-com-net.com/image/info10/392deaf903e64036904b763fd4db432b.jpg)
two.jpeg
依次选择
选择完毕之后点击如下图
![](http://img.e-com-net.com/image/info10/03d0f95cfb8c4e8d91e14c5315e5b37c.jpg)
four.jpeg
依照图中方法新创建LaunchImage
创建完成后
![](http://img.e-com-net.com/image/info10/60e5b849f1f847e8bcd474a8f118cb64.jpg)
five.jpeg
刚创建完成后进入时如图
根据下图选择,图片格式及尺寸一定不能错
如果图片格式或者图片尺寸选择错误就会出现下图问题
启动图变成了拉伸的app图标
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]; // 设置启动页面时间
}