基本上,我正在围绕一个点旋转一个图层,如下所示:
我还创建了一个图层,将其添加到一个更大的图层中,然后对其进行变换:
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
的动画块中不起作用。
UIView
动画 :) - tipycalFlow