iOS 技术分享

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;
上一篇 下一篇

猜你喜欢

热点阅读