基本上,我正在围绕一个点旋转一层:
CATransform3D transform = CATransform3DIdentity;
transform.m34 = 1.0 / -500;
transform = CATransform3DTranslate(transform, rotationPoint.x-center.x, rotationPoint.y-center.y, 0.0);
transform = CATransform3DRotate(transform, (rotationAngleFor) * M_PI / 180.0f, 0.0, 1.0, 0);
transform = CATransform3DTranslate(transform, center.x-rotationPoint.x, center.y-rotationPoint.y, 0.0);
我还创建了一个图层,将其添加到更大的图层,然后对其应用变换:
[self.layer addSublayer:myLayer];
myLayer.transform = transform;
如何动画化这个?
注意 -把它放在UIView
动画块中是行不通的。