Zum Beispiel habe ich diese CAKeyframeAnimation:Welche Art von Wert ist keyTime in einer CAKeyFrameAnimation?
CALayer* theLayer = myView.layer;
CAKeyframeAnimation* animation;
animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.rotation.z"];
animation.duration = 1.6;
//animation.cumulative = YES;
animation.repeatCount = 1;
animation.removedOnCompletion = NO;
animation.fillMode = kCAFillModeForwards;
animation.values = [NSArray arrayWithObjects:
[NSNumber numberWithFloat:0.0 * M_PI],
[NSNumber numberWithFloat:(15.0/180.0) * M_PI],
[NSNumber numberWithFloat:(30.0/180.0) * M_PI], // animation stops here...
[NSNumber numberWithFloat:(45.0/180.0) * M_PI], // ignored!
[NSNumber numberWithFloat:(190.0/180.0) * M_PI], nil]; // ignored!
animation.keyTimes = [NSArray arrayWithObjects:
[NSNumber numberWithFloat:0.0],
[NSNumber numberWithFloat:0.2],
[NSNumber numberWithFloat:0.4], // ignored!
[NSNumber numberWithFloat:0.8], // ignored!
[NSNumber numberWithFloat:1.6], nil]; // ignored!
animation.timingFunctions = [NSArray arrayWithObjects:
[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear],
[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear],
[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear],
[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear],
[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear], nil];
[theLayer addAnimation:animation forKey:@"transform.rotation.z"];
Was ich nicht bekommen, ist:
A) sind wichtige Zeitwert absolut vergangene Zeit seit der Animation begonnen hat?
B) sind wichtige Zeitwerte, die nur sagen, wie viel Zeit für diesen bestimmten Schlüsselrahmen zu verwenden ist?