0
家伙动画圆角矩形我有下面的代码产生bezierpath与CoreAnimation
firstLine.path = UIBezierPath(roundedRect: CGRect(x: frameSize.width/2.2, y: frameSize.height/2.6, width: 4, height: 4), cornerRadius: 10).cgPath
我尝试通过X值和回原来的位置将其移动到屏幕右侧的动画于firstLine。但我不知道在动画中keyPath使用什么。
let animation = CABasicAnimation(keyPath: "??")
animation.toValue = // this should be the position to move?
animation.duration = 0.5 // duration of the animation
animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseOut) // animation curve is Ease Out
animation.fillMode = kCAFillModeBoth // keep to value after finishing
animation.isRemovedOnCompletion = false // don't remove after finishing
animation.autoreverses = true
animation.repeatCount = HUGE
有人可以帮助我走出这个:)
位置的keyPath以某种方式不工作的bezierpath。 – Reshad
@Reshad你可以添加你用来移动贝塞尔路径的代码吗? –