BezierPath 使用(1)-- 绘制圆角

来源:互联网 发布:常用接入网络管理方式 编辑:程序博客网 时间:2024/06/10 06:15

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

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

    maskLayer.frame = portrait.bounds;

    maskLayer.path = maskPath.CGPath;

    portrait.layer.mask = maskLayer;

    [maskLayer release];

0 0
原创粉丝点击