ios 指定角度圆角

来源:互联网 发布:路由器封lol端口 编辑:程序博客网 时间:2024/05/06 13:24

 // 指定角度圆角

    UIBezierPath *maskPath = [UIBezierPathbezierPathWithRoundedRect:_viewBackground.boundsbyRoundingCorners:UIRectCornerTopLeft |UIRectCornerTopRight cornerRadii:CGSizeMake(10,10)];

    CAShapeLayer *maskLayer = [[CAShapeLayeralloc] init];

    maskLayer.frame =_viewBackground.bounds;

    maskLayer.path = maskPath.CGPath;

    _viewBackground.layer.mask = maskLayer;

0 0