2
有沒有一種方法,而這是動畫來改變重複CABasicAnimation
的價值?慢了下來CABasicAnimation,而它的動畫
所以我有以下晃動動畫:
CABasicAnimation * shake=[CABasicAnimation animationWithKeyPath:@"position"];
[shake setDuration:0.05];
[shake setRepeatCount:130];
[shake setAutoreverses:YES];
[shake setFromValue:[NSValue valueWithCGPoint:CGPointMake([clock center].x-12.0f, [clock center].y)]];
[shake setToValue:[NSValue valueWithCGPoint:CGPointMake([clock center].x+12.0f, [clock center].y)]];
[shake setDelegate:self];
[[clock layer] addAnimation:shake forKey:@"position"];
我想搖放慢朝這個動畫的結尾。我認爲這可以做,如果我可以調整duration
而動畫重複,但我找不到這樣做。
我的第二個想法是有幾個動畫,一個接一個的運行,每個動畫具有比前一個稍長的時間。但我希望有一個更優雅的方式來做到這一點。
'速度'是一個很好的屬性,以及玩:) –