0
이 코드가 10.6 및 10.7에서 잘 작동하는 이유는 정말 혼란 스럽지만 10.8에서는 애니메이션이없고 불투명도 값이 즉시 변경됩니다. Self는 NSView 하위 클래스입니다. Mountain Lion에서 레이어 불투명도의 애니메이션이 움직이지 않습니다
[CATransaction begin];
[CATransaction setValue:[NSNumber numberWithFloat:0.5]
forKey:kCATransactionAnimationDuration];
self.layer.opacity = 1.0;
self.labelFilename.layer.opacity = 1.0;
self.labelDate.layer.opacity = 1.0;
[CATransaction commit];
는 반대로이 코드는 10.6에 애니메이션 실패하지만, 10.7 및 10.8
CABasicAnimation *theAnimation;
theAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"];
theAnimation.duration = 0.5;
theAnimation.timingFunction = [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionEaseInEaseOut];
theAnimation.toValue=[NSNumber numberWithFloat:1.0];
theAnimation.removedOnCompletion = NO;
theAnimation.fillMode = kCAFillModeForwards;
[self.layer addAnimation:theAnimation forKey:@"fadeUp"];
[self.labelFilename.layer addAnimation:theAnimation forKey:@"fadeUpName"];
[self.labelDate.layer addAnimation:theAnimation forKey:@"fadeUpDate"];
저는 비슷한 문제가 있습니다. 이 문제의 원인을 파악할 수 있었습니까? – Martin
10.8에서 CAAnimation과 유사한 문제가 있습니다 (예 : http://stackoverflow.com/questions/13307632/nsimageview-layer-not-updating-before-during-animation). 이 문제에 대한 진전 사항은 무엇입니까? – thumbsup