Horizontal gradient is working fine. Is there any way to get a vertical color gradient from horizontal gradient? I have seen a related question regarding this where they did this by rotating the frames.
Is there any simpler way to achieve a vertical gradient?
How about rotating it 90º?
edit judging from your comment, it seems that you're doing this via
CAGradientLayer.CAGradientLayeris a subclass ofCALayer, which has atransformproperty. Thistransformproperty takes aCATransform3D, which is a struct that represents some sort of linear transformation to be applied to the layer (such as scaling, translation, or rotation).So really you just need to make a rotational
CATransform3Dand set it as thetransformproperty of yourCAGradientLayer.You could probably also make this work by fiddling with the
startPointandendPoint(which would actually probably be simpler).