我使用的CABasicAnimation圖像360順時針旋轉,並且其我使用的代碼是顯示像淡入使用圖像中CABasicAnimation
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"];
動畫工作正常。但我不能找出一個事情。我想從較小的尺寸開始動畫化圖像,並以正常尺寸結束。你在電影中看到過一些報紙會快速旋轉,並且它們漸漸消失,最後我們會完全看到屏幕上的紙張。我正在試圖這樣做。我不知道該怎麼做,請!