2011-10-04 23 views

Trả lời

2

Bạn có thể bắt đầu một hoạt ảnh cơ bản mới với tốc độ khác nhau và lấy làm giá trị bắt đầu mà bạn nhận được từ lớp trình bày.

4

Bạn có thể xem https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CoreAnimation_guide/AdvancedAnimationTricks/AdvancedAnimationTricks.html#//apple_ref/doc/uid/TP40004514-CH8-SW2

Và tôi sử dụng mã này.

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. nó thực sự đã giúp tôi – ShineWang

Các vấn đề liên quan