xcode7、iOS 后设置启动图片(Launch Image)

来源:互联网 发布:无主之地ol激活码淘宝 编辑:程序博客网 时间:2024/06/06 00:45


转: http://www.codes51.com/article/detail_195262.html


一.添加启动图片

  • 点击Image.xcassets进入图片管理,右击,弹出"New Launch Image"或点下面的+号创建Launch Image;
  • 如图,右侧的勾选可以让你选择是否要对ipad,横屏,竖屏,以及低版本的ios系统做支持.这边我选了ios8.0和ios7.0。

xcode7、iOS 后设置启动图片(Launch Image)

二.拖入相应尺寸的图片,以本例子需要为例。

我试了一下这里的图片名字可以任意命名,不过格式必须为png格式,如果只是写个demo,也可以下载我所用的这套图片 http://download.csdn.net/download/riven_wn/9196015。

640*960   (4/4s)                                 2X位置

640*1136  (5/5s/5c)                      R4位置

750*1334   (6)                               R4.7位置

1242*2208  (6 plus)                      R5.5位置

三.General里面的设置。

如图,Launch Image Source 要设置为LaunchImage,Launch Screen File的内容删除为空。

xcode7、iOS 后设置启动图片(Launch Image)

四.要把LaunchScreen.storyboard(低版本Xcode为LaunchScreen.xib)中的用作LaunchScreen的复选框勾选取消掉,如图。

xcode7、iOS 后设置启动图片(Launch Image)

到这里就大功告成了,so easy,不过有时候会出现第一次运行显示不正常的情况,一般把App删除重新run一遍就好了。

如果觉得显示时间不能满足需求,可以添加此方法延长显示时间(此为swift版本,oc类似)

<<span id="3_nwp" style="width: auto; height: auto; float: none;"><a target=_blank id="3_nwl" href="http://cpro.baidu.com/cpro/ui/uijs.php?adclass=0&app_id=0&c=news&cf=1001&ch=0&di=128&fv=18&is_app=0&jk=8b6cf28c9f5340eb&k=span&k0=span&kdi0=0&luki=4&mcpm=0&n=10&p=baidu&q=85048100_cpr&rb=0&rs=1&seller_id=1&sid=eb40539f8cf26c8b&ssp2=1&stid=9&t=tpclicked3_hc&td=1797308&tu=u1797308&u=http%3A%2F%2Fwww%2Ecodes51%2Ecom%2Farticle%2Fdetail%5F195262%2Ehtml&urlid=0" target="_blank" style="color: rgb(0, 0, 0); text-decoration: none;"><span style="font-size:12px;color:#00ff;width: auto; height: auto; float: none;">span</span></a></span> <span id="4_nwp" style="width: auto; height: auto; float: none;"><a target=_blank id="4_nwl" href="http://cpro.baidu.com/cpro/ui/uijs.php?adclass=0&app_id=0&c=news&cf=1001&ch=0&di=128&fv=18&is_app=0&jk=8b6cf28c9f5340eb&k=style&k0=style&kdi0=0&luki=3&mcpm=0&n=10&p=baidu&q=85048100_cpr&rb=0&rs=1&seller_id=1&sid=eb40539f8cf26c8b&ssp2=1&stid=9&t=tpclicked3_hc&td=1797308&tu=u1797308&u=http%3A%2F%2Fwww%2Ecodes51%2Ecom%2Farticle%2Fdetail%5F195262%2Ehtml&urlid=0" target="_blank" style="color: rgb(0, 0, 0); text-decoration: none;"><span style="font-size:12px;color:#00ff;width: auto; height: auto; float: none;">style</span></a></span>="font-family:Arial;"> override func viewDidLoad() {        super.viewDidLoad()        NSThread.sleepForTimeInterval(3.0)//延长3秒}</span>

以上就介绍了xcode7、iOS 后设置启动图片(Launch Image),包括了ios7方面的内容,希望对IOS开发有兴趣的朋友有所帮助。


0 0
原创粉丝点击