Drawing a circle

- (void)drawRect:(CGRect)rect {

CGFloat lineWidth = 2;
CGRect borderRect = CGRectMake(self.frame.size.width/2, self.frame.size.height - 20, 10.0, 10.0);
borderRect = CGRectInset(borderRect, lineWidth * 0.5, lineWidth * 0.5);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetRGBStrokeColor(context, 85.0/255.0, 143.0/255.0, 220.0/255.0, 1.0);
CGContextSetRGBFillColor(context, 5.0/255.0, 43.0/255.0, 20.0/255.0, 1.0);
CGContextSetLineWidth(context, 2.0);
CGContextFillEllipseInRect (context, borderRect);
CGContextStrokeEllipseInRect(context, borderRect);
CGContextFillPath(context);
}

原文地址:https://www.cnblogs.com/qike/p/4647413.html