我可以在启动屏幕xcode中使用渐变颜色吗 [英] can I use a Gradient color in Launch screen xcode

查看:64
本文介绍了我可以在启动屏幕xcode中使用渐变颜色吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以在launchscreen.storyboards中使用渐变颜色,如果可以的话,我可以在哪里进行编辑.我不希望添加图像,因为它会使应用变重,但可能是将渐变从a色更改为b色的过渡.预先感谢.

I want to know if it's possible to use gradient colors in the launchscreen.storyboards if so where can I edit it. I'm not looking to add images because it can make the app to heavy but maybe a transition to change the gradient from a-colors to b-colors. thanks in advance.

推荐答案

如果要在情节提要中以编程方式呈现渐变,通常可以定义

If you want to render gradients programmatically in a storyboard, you can generally define a UIView subclass to do that, but you cannot use custom classes in the launch screen. You’ll have to use an image.

如果您的渐变是简单的垂直或水平渐变,并且您确实担心资产的大小,则可以定义一个非常狭窄的图像,然后使用缩放比例填充"内容模式添加一个图像视图.

If your gradient is a simple vertical or horizontal gradient, and you’re really concerned about asset size, you can define a very narrow image and then add an image view with "scale to fill" content mode.

但是这些图像是如此之小,节省的空间可以忽略不计,所以我不确定是否值得担心.

But these images are so small anyway, the amount of space saved will be negligible, so I’m not sure it’s worth worrying about.

这篇关于我可以在启动屏幕xcode中使用渐变颜色吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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