can I use a Gradient color in Launch screen xcode

柔情痞子 提交于 2021-01-28 12:14:22

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/54521052/can-i-use-a-gradient-color-in-launch-screen-xcode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!