Masking the CAGradientLayer to the CAShape level

Help Needed: I am having a problem creating a gradient filled shape. To create the shape, I use the CAShape layer and mask it with CGPath showing an arrow. It works. However, I can only mask the CAGradient layer if I set its frame to the same size as the view the layer is attached to. This leads to the effect shown below: Shape

I only get part of the gradient I want to fill the shape layer. I have included a picture below to show the intended shape compared to the one currently created.  arrows with gradients

Any news? Thank!

+3
objective-c cagradientlayer cashapelayer cgpath


source to share


No one has answered this question yet

Check out similar questions:

thirty
Adding circle mask layer to UIImageView
29
Applying a gradient to the CAShapeLayer
2
Custom layer mask for UIView
2
CAG gradient level is not visible in view
2
Add a gradient color to each layer.
1
Create CGpath from UIimageview with rotation and scaling to use as cglayer mask
0
Gradient of the picture below the CAShapeLayer graph
0
"CAGradientLayer" Defines start and end points in terms of local coordinate space
0
CAGradientLayer SetMask for CAShapeLayer application
0
CAGradientLayer - unexpected output when masking CAShapeLayer from UIBezierPath



All Articles
Loading...
X
Show
Funny
Dev
Pics