问题
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