0
我用这个作为特征的那昏暗的圆形区域外的屏幕,该屏幕将保持不变的基础:调色切出面具
Mask a UIView with a cut-out circle
但我想这样做是有选择地将圆圈染成红色,但是我所有的尝试都失败了。请问我哪里错了?
[[self fillColor] set];
UIRectFill(rect);
CGContextRef context = UIGraphicsGetCurrentContext();
UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect: self.circleFrame];
if (self.tintCircle)
{
float red[4] = {1,0,0,1};
CGContextSetFillColor(context, red);
[path fill];
}
else
{
[path fillWithBlendMode:kCGBlendModeDestinationOut alpha:1.0];
}