如何只用它的笔画画圆圈

时间:2013-07-12 08:23:36

标签: ios quartz-graphics geometry

我只是想用笔划绘制圆圈,下面的代码画得很好,但它填满了圆圈。

我不希望它被填满。请帮帮我

    self.circleView = [[UIView alloc] initWithFrame:CGRectMake(10,20,20,20)];
    circleView.alpha = 0.5;
    self.circleView.layer.cornerRadius = 50;
    self.circleView.backgroundColor = [UIColor whiteColor];

1 个答案:

答案 0 :(得分:1)

更改

self.circleView.backgroundColor = [UIColor whiteColor];

self.circleView.backgroundColor = [UIColor clearColor];

并为边框(Stroke)添加

self.circleView.layer.borderColor = [[UIColor redColor] CGColor];
self.circleView.layer.borderWidth = 1;