ios - 如何只用笔画画圆

标签 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];

最佳答案

改变

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/

相关文章:

iphone - 如何检查 iTunes 上是否有新版本?

ios - 为什么围绕 x 轴平移 CALayer 会影响围绕 Y 轴的旋转

objective-c - 如何在触摸时更改一个 UITableViewCell

iphone - Core Graphics,如何绘制带有椭圆透明孔的矩形?

iphone - 未找到 CATransform3DMakeRotation 符号

macos - 如何将 CGEventKeyboardSetUnicodeString 与多个字符一起使用?

css - 在 CSS 中以圆圈形式垂直和水平居中文本(如 iphone 通知徽章)

iphone - 如何跟踪iPad应用程序中播放的视频时长

javascript - 使用 three.js 加载 OBJMTL 对象并获取 Mesh 的几何参数

确定网格单元格上的 Blob 重叠百分比的算法