UIView单独设置4个边角的圆角

UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.checkBtn.bounds      byRoundingCorners:UIRectCornerTopRight | UIRectCornerBottomRight    cornerRadii:CGSizeMake(20, 20)];

CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];

maskLayer.frame = self.checkBtn.bounds;

maskLayer.path = maskPath.CGPath;

self.checkBtn.layer.mask = maskLayer;

你可能感兴趣的:(UIView单独设置4个边角的圆角)