作者:1074017584_789ded | 来源:互联网 | 2023-05-18 19:28
UIBezierPath*maskPath[UIBezierPathbezierPathWithRoundedRect:view2.boundsbyRoundingCorners:UIRectCornerBottomRight|UIRectCornerT
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:view2.bounds byRoundingCorners:UIRectCornerBottomRight | UIRectCornerTopRight cornerRadii:CGSizeMake(40, 40)];
// 这里 40 40 表示圆弧的角度 前面的参数有四个类型 左上角 左下角 右上角 右下角
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = view2.bounds;
maskLayer.path = maskPath.CGPath;
view2.layer.mask = maskLayer;