CAShapeLayer *circleLayer = [CAShapeLayer layer];// Give the layer the same bounds as your image vIEw[circleLayer setBounds:CGRectMake(0.0f,0.0f,[photoVIEw bounds].size.wIDth,[photoVIEw bounds].size.height)];// position the circle anywhere you like,but this will center it// In the parent layer,which will be your image vIEw's root layer[circleLayer setposition:CGPointMake(coordsFinal.x + 130,coordsFinal.y + 200)];// Create a circle path.UIBezIErPath *path = [UIBezIErPath bezIErPathWith@R_404_6631@InRect: CGRectMake(0.0f,50.0f,50.0f)];// Set the path on the layer[circleLayer setPath:[path CGPath]];// Set the stroke color[circleLayer setstrokecolor:[color CGcolor]];// Set the stroke line wIDth[circleLayer setlinewidth:2.0f];// Add the sublayer to the image vIEw's layer tree[[photoVIEw layer] addSublayer:circleLayer];
我希望圈子是空的,只有边界.如何清除填充?
解决方法 将填充颜色设置为透明(Alpha 0)[circleLayer setFillcolor:[[UIcolor colorWithWhite:0 Alpha:0] CGcolor]];
AKA …
[circleLayer setFillcolor:[[UIcolor clearcolor] CGcolor]];
(谢谢Zev)
总结以上是内存溢出为你收集整理的绘图圆没有填写IOS全部内容,希望文章能够帮你解决绘图圆没有填写IOS所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)