美文网首页
2022-02-11 iOS 切任意圆角

2022-02-11 iOS 切任意圆角

作者: cc帅气的昵称 | 来源:发表于2022-02-11 17:02 被阅读0次

UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.hotBg.bounds byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(6, 6)];

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

    maskLayer.frame=self.hotBg.bounds;

    maskLayer.path= maskPath.CGPath;

    self.hotBg.layer.mask= maskLayer;

相关文章

网友评论

      本文标题:2022-02-11 iOS 切任意圆角

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