小编Pet*_*dil的帖子

即使使用kCGLineCapRound,也无法在UIBezierPath Arc中圆角

我无法在使用UIBezierPath创建的Arc上显示圆角.无论我是否设置kCGLineCapRound,它仍然是完美的平方.

此主题应该是一样的这一个,但是解决方案是行不通的.

这是我在viewWillAppear中的示例代码(仅用于测试目的):

int radius = 100;
CAShapeLayer *arc = [CAShapeLayer layer];
UIBezierPath *path = [UIBezierPath bezierPathWithArcCenter:CGPointMake(100, 50) radius:radius startAngle:M_PI endAngle:M_PI/150 clockwise:YES];
path.lineCapStyle = kCGLineCapRound;

arc.path = path.CGPath;
arc.position = CGPointMake(CGRectGetMidX(self.view.frame)-radius, CGRectGetMidY(self.view.frame)-radius);
arc.fillColor = [UIColor clearColor].CGColor;
arc.strokeColor = [UIColor purpleColor].CGColor;
arc.lineWidth = 10.0f;
arc.cornerRadius = 3.0f;
Run Code Online (Sandbox Code Playgroud)

以下是它的外观:

WHYY

我很无奈,所以我会感激任何帮助.多谢你们.

objective-c rounded-corners ios uibezierpath

11
推荐指数
1
解决办法
4340
查看次数

标签 统计

ios ×1

objective-c ×1

rounded-corners ×1

uibezierpath ×1