私はパーセンテージに基づいて塗りつぶされた円を持っていますが、多色の境界線を持つ必要があります。つまり、0〜10はオレンジ、10〜50は青、0.50〜0.70は紫色です。 70-1は黒です。マルチカラーボーダーはどうやって取得できますか?
let circlePath = UIBezierPath(arcCenter: CGPointMake(cell.progress.frame.width/2, cell.progress.frame.height/2), radius: CGFloat(60), startAngle: CGFloat(-M_PI_2), endAngle:CGFloat(M_PI * 2 * percentage - M_PI_2), clockwise: true)
let shapeLayer = CAShapeLayer()
shapeLayer.path = circlePath.CGPath
shapeLayer.fillColor = UIColor.clearColor().CGColor
shapeLayer.strokeColor = UIColor.redColor().CGColor
shapeLayer.lineWidth = 3.0
cell.progress.layer.addSublayer(shapeLayer)
達成したいことの写真を提供してください。 – matt
このようなものでは、色の範囲が違う必要があります。https://www.google.com/search?q=multi+color+circle+border&safe=strict&espv=2&biw=1164&bih=641&source=lnms&tbm=isch&sa=X&ved=0ahUKEwjrwO-Kk -TMAhWKPCYKHYVLBbAQ_AUIBigB#imgrc = CJTN91lRO2WmVM%3A – johnson
Cool!私はそれがあなたが意味するものかもしれないと思った... – matt