0
我想在我的应用程序中拥有这种动画,这种情况下箭头形状可以在点击时转换为标记。斯威夫特的动画
这就是我使用以下
func handleTransform(){
let arrowPath = UIBezierPath()
arrowPath.move(to: CGPoint(x: 50, y: 0))
arrowPath.addLine(to: CGPoint(x: 25, y: 75))
arrowPath.addLine(to: CGPoint(x: 25, y: 75))
arrowPath.addLine(to: CGPoint(x: 25, y: 45))
arrowPath.addLine(to: CGPoint(x: 25, y: 35))
arrowPath.close()
let progressLines = CAShapeLayer()
progressLines.path = arrowPath.cgPath
progressLines.strokeColor = UIColor.black.cgColor
progressLines.fillColor = UIColor.clear.cgColor
progressLines.lineWidth = 10.0
progressLines.lineCap = kCALineCapRound
self.view.layer.addSublayer(progressLines)
let animateStrokeEnd = CABasicAnimation(keyPath: "strokeEnd")
animateStrokeEnd.duration = 3.0
animateStrokeEnd.fromValue = 0.0
animateStrokeEnd.toValue = 1.0
progressLines.add(animateStrokeEnd, forKey: "animate stroke end animation")
}
代码具有在本流程中示出图像中的波纹管
你有此按钮后,尝试简单的“图像转换”开关图像被点击? – Vexy
@EricAya我已经添加了我尝试做的代码,没有找到解决方案的地方 – SimpiMind
@Vexy我不认为切换图像会起作用,因为第二个图像比第一个图像长一点 – SimpiMind