CAGradientLayer
suggest changeSyntax
- CAGradientLayer() // Returns an initialized CALayer object.
- CAGradientLayer(layer: layer) // Override to copy or initialize custom fields of the specified layer.
Parameters
Parameter | Details |
—— | —— |
color | An array of CGColorRef
objects defining the color of each gradient stop. Animatable. |
locations | An optional array of NSNumber
objects defining the location of each gradient stop. Animatable. |
endPoint | The end point of the gradient when drawn in the layer’s coordinate space. Animatable. |
startPoint | The start point of the gradient when drawn in the layer’s coordinate space. Animatable. |
type | Style of gradient drawn by the layer. Defaults to kCAGradientLayerAxial
. |
Remarks
- Use
startPoint
andendPoint
to change the orientation of theCAGradientLayer
. - Use the
locations
to affect the spread/positions of the colors.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents