UIBezierPath * bezierPath = [UIBezierPath bezierPathWithRoundedRect:skinSource.bounds byRoundingCorners:UIRectCornerBottomRight | UIRectCornerTopRight cornerRadii:CGSizeMake(14, 14)];
CAShapeLayer *maskLayer = [CAShapeLayer layer];
maskLayer.frame = skinSource.bounds;
maskLayer.path = bezierPath.CGPath;
skinSource.layer.mask = maskLayer;
typedef NS_OPTIONS(NSUInteger, UIRectCorner) {
UIRectCornerTopLeft = 1 << 0,
UIRectCornerTopRight = 1 << 1,
UIRectCornerBottomLeft = 1 << 2,
UIRectCornerBottomRight = 1 << 3,
UIRectCornerAllCorners = ~0UL
};
时间: 2024-10-11 17:49:48