iOS - 圆角处理(忘了抠1)
@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
网友评论