在资产目录中为iOS启动图像使用矢量插图? [英] Use vector artwork for iOS launch image in asset catalog?

查看:87
本文介绍了在资产目录中为iOS启动图像使用矢量插图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能吗?看来我将需要9个不同的启动图像,因此全部替换它们将有些麻烦.

Is this possible? It looks like I am going to need 9 different launch images, so replacing them all would be a bit of a chore.

推荐答案

不幸的是,我认为您不能对所有的LaunchImage使用矢量图稿... ...但是有一种方法可以使我们的生活更轻松:新的LaunchScreen.xib.

Unfortunately, I think you can't use vector artwork for ALL of your LaunchImages... ... but there's an approach which makes our lives easier: the new LaunchScreen.xib.

在文件">新建"中,您将在用户界面中创建一个新的启动屏幕:

In File > New, you create a new Launch Screen in User Interface:

现在,您可以在项目的目标中设置新的启动屏幕文件:

Now, you can set the new Launch Screen File in your project's target:

在此LaunchScreen.xib中,您可以放置​​矢量插图,并使用自动布局使矢量适应所有屏幕尺寸.

In this LaunchScreen.xib you can put your vector artwork, using AutoLayout for adapt your vector to all screen sizes.

为什么我告诉您不能对所有尺寸都使用矢量插图?因为它仅适用于iOS 8+.对于iOS 7,我以旧方式创建了PNG图像,并将其放置在LaunchImage资产目录中.

Why I told that you can't use vector artwork for ALL sizes? Because it only works in iOS 8+. For iOS 7, I created the PNG image and I put this in LaunchImage asset catalog, in the old way.

PS:我仅在模拟器中测试了这种方法.

这篇关于在资产目录中为iOS启动图像使用矢量插图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆