0
私は斜めにアニメーション化するコードを持っています。NSButtonを回転させると回転しない
CABasicAnimation *rightAnimation = [CABasicAnimation animationWithKeyPath:@"transform.translation.x"];
[rightAnimation setToValue:[NSNumber numberWithFloat:160]];
[rightAnimation setBeginTime:0.0];
[rightAnimation setDuration:0.4];
CABasicAnimation *fall = [CABasicAnimation animationWithKeyPath:@"transform.translation.y"];
[fall setToValue:[NSNumber numberWithFloat:-20]];
[fall setBeginTime:0.1];
[fall setDuration:0.3];
//DOESN'T WORK
CABasicAnimation *rotate = [CABasicAnimation animationWithKeyPath:@"transform.translation.z"];
[rotate setToValue:[NSNumber numberWithFloat:DEGREES_RADIANS(30)]];
[rotate setBeginTime:0.0];
[rotate setDuration:0.4];
CAAnimationGroup *group = [CAAnimationGroup animation];
[group setDuration:0.4];
[group setAnimations:[NSArray arrayWithObjects:rightAnimation, fall, rotate, nil]];
[submitButton.layer addAnimation:rotate forKey:nil];
私はまたボタンが30度回転したいと思っています。しかし、いくつかの奇妙な理由のために、これは起こらない、どのように来る?