2011-10-04 17 views

risposta

2

È possibile avviare una nuova animazione di base con velocità diversa e prendere come valore iniziale quello che si riceve dal livello di presentazione.

4

Si può vedere https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CoreAnimation_guide/AdvancedAnimationTricks/AdvancedAnimationTricks.html#//apple_ref/doc/uid/TP40004514-CH8-SW2

e io uso questo codice.

Objective-C

self.layer.timeOffset = [self.layer convertTime:CACurrentMediaTime() fromLayer:nil]; 
self.layer.beginTime = CACurrentMediaTime(); 
self.layer.speed= theSpeedYouWant; 

Swift

self.layer.timeOffset = self.layer.convertTime(CACurrentMediaTime(), fromLayer: nil) 
self.layer.beginTime = CACurrentMediaTime(); 
self.layer.speed = speed; 
+0

Thanks a lot. mi ha davvero aiutato – ShineWang

Problemi correlati