我只想用笔划画一个圆,下面的代码可以很好地绘制,但是可以填充圆。

我不希望它充满。请帮我

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

最佳答案

更改

self.circleView.backgroundColor = [UIColor whiteColor];




self.circleView.backgroundColor = [UIColor clearColor];


并为边框(描边)添加

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

10-08 11:48