iOS 虚线圆

作者: zxb有缘 | 来源:发表于2021-05-10 14:55 被阅读0次

    CAShapeLayer * line = [CAShapeLayer layer];
    CGMutablePathRef path = CGPathCreateMutable();
    line.fillColor = [UIColor clearColor].CGColor;
    line.strokeColor = rgb(190, 190, 190).CGColor;
    line.lineWidth = 10.0f;//长度

    CGPathAddEllipseInRect(path, nil, CGRectMake(imageView.x, imageView.y, imageView.width, imageView.height));
    line.path = path;
    line.lineDashPhase = 1.0;
    line.lineDashPattern = @[@1,@5];//@1:宽度 @5:间隔
    [imageView.layer addSublayer:line];
    
    Blowing Blowing@2x.png

    相关文章

      网友评论

        本文标题:iOS 虚线圆

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