I asked this question differently in the iPhone programming forum without any answer.
I have a path that I am stroking with a dashed line set to a width of 2. If I fill the path with either a solid fill or with a linear gradient I lose the dashed line of the path.
How can I fill the path and still see the stroked line?
I have a path that I am stroking with a dashed line set to a width of 2. If I fill the path with either a solid fill or with a linear gradient I lose the dashed line of the path.
How can I fill the path and still see the stroked line?
Code:
CGContextBeginPath(context);
.
.
//create the path
.
.
CGContextClosePath(context);
[[UIColor colorWithRed:0.808 green:0.58 blue:0.255 alpha:1.0] setFill];
CGContextFillPath(context);
[[UIColor blackColor] setStroke];
CGContextSetLineWidth(context, 2.0);
CGFloat dash1[] = {5.0, 2.0};
CGContextSetLineDash(context, 0.0, dash1, 2);
CGContextStrokePath(context);