0
[animationImageView setWantsLayer:YES];

CAKeyframeAnimation *keyframeAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position"];    
keyframeAnimation.values = [animationsBindingsController valueForKeyPath:@"selection.controlPoints"];
keyframeAnimation.duration = 5;
[animationImageView.layer addAnimation:keyframeAnimation forKey:@"position"];
[pageContent addSubview:animationImageView];

AnimationImageViewのサブクラスですNSImageView

animationImageViewオブジェクトは 5 秒間 (アニメーションの期間中) 消え、突然初期位置に表示されます。

4

1 に答える 1

0

OK、NSImageViewをサブクラス化する代わりに、CALayerをサブクラス化しました(メソッドsetContents:NSImageを設定できます)。Core Animationは完璧に機能します!

于 2011-10-16T09:41:04.773 に答える