您的位置:首页 > 移动开发 > IOS开发

iOS 启动图载入设置

2017-01-20 14:58 281 查看
1、使用代码设置,直接把相应图片拖进项目中
      现如今主流机型屏幕尺寸:
      
手机系列(尺寸)
物理屏幕(point)
屏幕像素(px)
4/4s(3.5寸)
320 x 480
640 x 960
5/5s/6se(4.0寸)
320 x 568
640 x 1136
6、7(4.7寸)
375 x 667
750 x 1334  

6p/7p(5.5寸)
621 x 1104
1242 x 2208
https://developer.apple.com/library/content/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Appendices/Properties.html

直接设置启动图(LaunchImage)片即可:
Default@2x.png(640 x 960)、Default-568h@2x.png(960 x 1136)、Default-667h@2x.png(750 x 1334)、Default-736h@3x.png(1242 x 2208)

AppIcon设置:
Icon-57@2x.png(114 x 114)、Icon@2x.png(120 x 120)、Icon@3x.png(180 x 180)

2、使用Images.xcassets设置适配屏幕,加载启动图:
找到Images.xcassets,点击然后右键新建LaunchImage和AppIcon,按照尺寸添加图片即可。
注意:
在项目 —> TARGETS —> App Icons Source 选择AppIcon选项
在项目 —> TARGETS —> Launch Image Source 选择LaunchImage选项
在项目 —> TARGETS —> App Icons and Launch Image —> Launch Screen File要清除此选项
还要把LaunchScreen.storyboard(低版本Xcode为LaunchScreen.xib)中的用作LaunchScreen的复选框勾选取消掉

3、直接使用项目 —> TARGETS —> App Icons and Launch Image —> Launch Screen File 选择需要设置为启动图xib文件或则storyboard,然后在对应文件上设置需要的启动图即可 。

补充:
// 延长启动图显示时间
[NSThreadsleepForTimeInterval:10.0];

参考资料:
http://blog.csdn.net/riven_wn/article/details/49275157

// iOS欢迎页面Launch Screen动态加载广告
http://www.open-open.com/lib/view/open1430270104443.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  iOS知识点 总结