//背景色
[[UIColor grayColor] set];
CGContextAddRect(ctx, rect);
CGContextFillPath(ctx);
//设置为清空模式
CGContextSetBlendMode(ctx, kCGBlendModeClear);
//画圆
CGContextFillEllipseInRect(ctx, circle);
//填充
CGContextFillPath(ctx);
效果: