I am a novice ios programmer.In one of my project i need to draw a circle in which different portion of the circle would be filled up with different colors.I can draw the circle.But i am not being able to determine the different portion of the circle and fill them with different color.Here is an screenshot to clarify what i want to draw.
A help would be appreciated.
解决方案
You can use UIBezierPath which has a method addArcWithCenter:radius:startAngle:endAngle:clockwise: where you can specify radius, center and angles. The code could look like this which draws a quarter of a circle in green:
CGPoint center = CGPointMake(CGRectGetWidth(self.bounds) / 2.f, CGRectGetHeight(self.bounds) / 2.f);
CGFloat radius