在view上面 剪切掉一部分
奶奶的熊 找了一下午才找到这个方法
- (void)drawRect:(CGRect)rect {
// Drawing code
[super drawRect:rect];
UIBezierPath *path = [UIBezierPath bezierPathWithRect:rect];
[path appendPath:[UIBezierPath bezierPathWithArcCenter:CGPointMake(20, 20) radius:20 startAngle:0 endAngle:2*M_PI clockwise:NO]];
CAShapeLayer *shapeLayer = [CAShapeLayer layer];
shapeLayer.path = path.CGPath;
[self.layer setMask:shapeLayer];
}

浙公网安备 33010602011771号