我只想用描边画圆,下面的代码画得很好,但它填满了圆。
我不想让它被填满。请帮助我
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;
关于ios - 如何只用笔画画圆,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17610596/