美文网首页
iOS - 圆角处理(忘了抠1)

iOS - 圆角处理(忘了抠1)

作者: lizhi_boy | 来源:发表于2019-06-12 11:25 被阅读0次
@implementation UIView (IEExtention)

-(void)filletWithSize:(CGSize)size Radius:(CGFloat)radius corner:(UIRectCorner)corner{
        CGRect rect = self.bounds;
        rect.size = size;
        UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:rect byRoundingCorners:corner cornerRadii:CGSizeMake(radius, radius)];
        CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
        maskLayer.frame = rect;
        maskLayer.path = path.CGPath;
        self.layer.mask = maskLayer;
}
@end

相关文章

网友评论

      本文标题:iOS - 圆角处理(忘了抠1)

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