Reputation: 25687
I am trying to draw a UIBezierPath
that fades out at both ends - from alpha 0
to 1
then back to 0
. I basically want to be able to draw a gradient in a UIBezierPath from within drawRect
.
EDIT: Here's the effect I'm trying to achieve:
Upvotes: 8
Views: 1509
Reputation: 1780
What about using -strokeWithBlendMode:alpha:
?
In combination with some sort of loop that keeps incrementing/decrementing the alpha value until you reach the 1 (and the increment determines the length of the "faded" segment) should work.
See here
Upvotes: 1