美文网首页
iOS Button切半边圆角

iOS Button切半边圆角

作者: 张天奇天张 | 来源:发表于2021-06-10 17:31 被阅读0次

    UIBezierPath *maskOnePath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_WIDTH, 1000) byRoundingCorners:UIRectCornerTopLeft | UIRectCornerBottomLeft cornerRadii:CGSizeMake(18, 18)];

    CAShapeLayer *maskOneLayer = [[CAShapeLayer alloc] init];

    maskOneLayer.frame = oneBtn.bounds;

    maskOneLayer.path = maskOnePath.CGPath;

    oneBtn.layer.mask = maskOneLayer;

    相关文章

      网友评论

          本文标题:iOS Button切半边圆角

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