开发遇到的那些坑-Launch Images
2016-11-21 本文已影响296人
NSL_zerom
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]; // 设置启动页面时间
}