直接上代码
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:_statusLab.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerBottomLeft cornerRadii:CGSizeMake(_statusLab.height / 2, _statusLab.height / 2)];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = _statusLab.bounds;
maskLayer.path = maskPath.CGPath;
_statusLab.layer.mask = maskLayer;
网友评论