iOS - UIButton 部分圆角
2020-04-07 本文已影响0人
Joh蜗牛
按钮左上角及左下角圆角:
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.signBtn.bounds byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerTopLeft cornerRadii:CGSizeMake(11, 11)];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = self.signBtn.bounds;
maskLayer.path = maskPath.CGPath;
self.signBtn.layer.mask = maskLayer;