iOS 中间显示透明圆


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

 
 
效果:

iOS 中间显示透明圆_第1张图片




你可能感兴趣的:(ios)