美文网首页iOS 技术分享
iOS - UIButton 部分圆角

iOS - UIButton 部分圆角

作者: Joh蜗牛 | 来源:发表于2020-04-07 17:04 被阅读0次

按钮左上角及左下角圆角:

    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;

相关文章

网友评论

    本文标题:iOS - UIButton 部分圆角

    本文链接:https://www.haomeiwen.com/subject/lgbnphtx.html