iOS 畫圓形

+(void)drawEllipse:(CGPoint)point withColor:(UIColor*)color withRad:(float)rad
{
    CGContextRef ctx = UIGraphicsGetCurrentContext();
    CGContextSetFillColorWithColor(ctx, [color CGColor]);
    CGContextFillEllipseInRect(ctx, CGRectMake(point.x-rad, point.y-rad, 2*rad, 2*rad));
}

直接調用傳入參數就能夠了code

相關文章
相關標籤/搜索