ios启动画面设置---launch Images(三步搞定)

转载地址: 点击打开链接


最近项目做的差不多了,折腾启动画面之类的东西,发现设置启动画面有点问题,折腾了一个晚上,最后发现是个小问题,在此记录下来,已经在ipad1(ios3.2)和new pad(ios6)上做了测试。

工程是基于cocos2d引擎的,希望在横屏情况下使用,时间关系,不写那么详细,按照本文的操作一定可以达到需要的效果。

参考网上的一段说明:

UILaunchImageFile (String - iPhone OS) specifies the name of the launch image file for the application. If this key is not specified, the system assumes a name of Default.png. This key is typically used by universal applications when different sets of launch images are needed for iPad versus iPhone or iPod touch devices.

If you include this key in your Info.plist file, any launch images you include in your application’s bundle should be based on the string. For example, suppose you want to include portrait and landscape launch images for iPad using the base name MyiPadImage.png. You would include the UILaunchImageFile~ipad key in your Info.plist file and set its value to MyiPadImage.png. You would then include a MyiPadImage-Portrait.png file and a MyiPadImage-Landscape.png file in your bundle to specify the corresponding launch images. 


意思很明显,(1)准备横屏和竖屏的启动画面的文件(如果只有竖屏,则准备竖屏的图片,如果只有横屏,则只需要准备横屏的图片,如果支持横竖屏切换,就准备两张吧,如果只支持横竖屏其中一种,记得在target->Summary->Supported Device Orientations 中选中支持的设备方向),如果你的info.plist没有配置LaunchImge,(2)就将横屏和竖屏的图片命名为Default-Landscape.png和Default-Portrait.png, (3)放到资源目录,添加到工程中,然后你就可以在target->Summary->Launch Images中看到啦,接下里clean工程跑下就没问题了。

如果你想把启动画面的那张图片做别的用处或者不想用Default-Landscape.png和Default-Portrait.png名字,可以配置info.plist(我的xcode是4.2的),修改或者添加Launch Image,然后设置值为XXX.png,添加横屏和竖屏的图片命名为XXX-Landscape.png和XXX-Portrait.png,添加到资源目录和工程,就可以啦。


有问题可以QQ联系我(609845230,注明csdn)

下面截图是我使用默认的名称而且只显示横屏启动画面的设置:





  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值