嗨,我有一个 UIImageView 部分在屏幕上,部分在屏幕外。
我想围绕屏幕外的一个点(视图的中心)旋转视图。
我该怎么做呢?
fullRotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
fullRotationAnimation.fromValue= [NSNumber numberWithFloat:0.0f];
fullRotationAnimation.toValue = [NSNumber numberWithFloat:2 * M_PI];
fullRotationAnimation.duration = 4;
fullRotationAnimation.repeatCount = 1;
[self->greyRings.layer addAnimation:fullRotationAnimation forKey:@"360"];
我目前正在使用该代码,但它只是围绕屏幕中心旋转。
请问有什么想法吗?