我正在使用UIBezierPath
繪製曲線。但曲線起作用,我無法曲線的邊緣。UIBezierPath - 添加圓角
如果你看一下曲線的頂部/底部結束,你可以看到,邊緣變平了,那不是我想要的。有沒有辦法曲線的邊緣?
我正在使用簡單的UIBezierPath
繪製(幾乎)半圓。這將創建一個我想要的曲線形狀:
CAShapeLayer *circle = [CAShapeLayer layer];
circle.path = [UIBezierPath bezierPathWithArcCenter:CGPointMake(0, 0) radius:70 startAngle:1.0472 endAngle:5.23599 clockwise:NO].CGPath;
circle.fillColor = [UIColor clearColor].CGColor;
circle.strokeColor = [UIColor colorWithWhite:1.0 alpha:0.2].CGColor;
circle.lineWidth = 18.0;
circle.cornerRadius = 10.0;
circle.position = CGPointMake(100, 100);
circle.anchorPoint = CGPointMake(0.5, 0.5);
[mainView.layer addSublayer:circle];
儘管設置cornerRadius
財產,邊角都沒有彎曲。我究竟做錯了什麼?
謝謝你的時間,丹。
完美的作品,謝謝! – Supertecnoboff