如何沿x轴垂直旋转CaLayer?

时间:2019-09-07 08:17:05

标签: swift calayer

我正在尝试制作与视频转换有关的应用程序。我已经使用CABasicAnimation来旋转CaLayer。它使我旋转。我希望CaLayer沿yhr X轴垂直旋转。我该怎么办?

let rotationAnimationx = CABasicAnimation(keyPath: "transform.rotation.x")

rotationAnimationx.fromValue = 0
rotationAnimationx.byValue = Double.pi * 2            
rotationAnimationx.duration = 3
rotationAnimationx.beginTime = CFTimeInterval(time[image])
rotationAnimationx.fillMode = CAMediaTimingFillMode.forwards
rotationAnimationx.isRemovedOnCompletion = false

blackLayer.add(rotationAnimationx, forKey: "transform.rotation.x")

0 个答案:

没有答案