I would like to create a UIBezierPath with 10px rounded corners and with gradient fill. How can I achieve this effect?
Here is an image of what I want to do:

As you can see, this square has:
- 2px black frame
- 10px rounded corners
- red to green fill linear gradient
How can I do this programmatically without using the color of the picture image ?
This is how I create the path:
UIBezierPath *border = [UIBezierPath bezierPathWithRoundedRect:self.bounds cornerRadius:10.0f]; [border setLineWidth:2]; [[UIColor blackColor] setStroke]; [border stroke]; [[UIColor redColor] setFill]; <-- what should I put here? [border fill];
iphone core-graphics uibezierpath drawing
akashivskyy
source share