iOS 虚线圆
2021-05-10 本文已影响0人
zxb有缘
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];
