CAKeyframeAnimation在设备/模拟器上不同

时间:2016-12-02 03:16:14

标签: ios core-animation cakeyframeanimation

所以我使用CAKeyframeAnimation旋转图层360 * s。它在iPhone 6和iOS模拟器上按预期工作:

http://www.goloskok.com/u/cap_2016-12-02_12-51-28_pm.mov

但在iPad mini 1st Gen上看起来有所不同:

http://goloskok.com/u/ipad-C97WYOhVhj.mov

我怀疑这与iPad mini是32位有什么关系?

我使用的代码是:

[NSValue valueWithCATransform3D:RTSpinKit3DRotationWithPerspective(1.0/120.0, 0.0, 0.0, 0.0, 0.0)],
[NSValue valueWithCATransform3D:RTSpinKit3DRotationWithPerspective(1.0/120.0, 0.5 * M_PI, 0.0, 1.0, 0.0)],
[NSValue valueWithCATransform3D:RTSpinKit3DRotationWithPerspective(1.0/120.0, M_PI, 0.0, 1.0, 0.0)],
[NSValue valueWithCATransform3D:RTSpinKit3DRotationWithPerspective(1.0/120.0, 2 * M_PI, 0.0, 1.0, 0.0)],
[NSValue valueWithCATransform3D:RTSpinKit3DRotationWithPerspective(1.0/120.0, 0.0, 0.0, 0.0, 0.0)]

使用的函数是:

CATransform3D RTSpinKit3DRotationWithPerspective(CGFloat perspective, CGFloat angle, CGFloat x, CGFloat y, CGFloat z) {
    CATransform3D transform = CATransform3DIdentity;
    transform.m34 = perspective;
    return CATransform3DRotate(transform, angle, x, y, z);
}

0 个答案:

没有答案