我正在使用 CABasicAnimation 顺时针旋转 Image 360,我使用的代码是
CALayer* _caLayer = [CALayer layer];
_caLayer.contents = (id)_logo.CGImage;
_caLayer.frame = CGRectMake(65,158, 180,55);
[self.view.layer addSublayer:_caLayer];
CABasicAnimation* rotation;
rotation = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
rotation.fromValue = [NSNumber numberWithFloat:0];
rotation.toValue = [NSNumber numberWithFloat:((360*M_PI)/180)];
rotation.duration = 1.4f;
//rotation.beginTime = CACurrentMediaTime() +1;
rotation.repeatCount = 2.0;
rotation.fillMode = kCAFillModeForwards;
[_caLayer addAnimation:rotation forKey:@"360"];
动画效果很好..但我无法弄清楚一件事。我想从较小的尺寸开始动画图像并以正常尺寸结束。你已经在电影中看到了一些报纸会快速旋转并淡入,最后我们会在屏幕上完全看到报纸。我正在尝试这样做。我不知道该怎么做,拜托!