コアプロットの散布図(折れ線グラフなど)を拡大縮小して、表示に拡大しようとしています。CorePlotは、通常のCALayerを使用してそのプロットを実装します。
私はこれを達成するために次のようにCoreAnimationを使用しています:
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"affineTransform"];
animation.duration = 10;
animation.removedOnCompletion = YES;
animation.fillMode = kCAFillModeForwards;
CGAffineTransform start = CGAffineTransformMakeScale(1, 0.1);
CGAffineTransform end = CGAffineTransformMakeScale(1, 1);
animation.fromValue = [NSValue valueWithCGAffineTransform:start];
animation.toValue = [NSValue valueWithCGAffineTransform:end];
[plot addAnimation:animation forKey:@"animation"];
問題は、これが機能していないように見えることです。Core Animationを使用するのはこれが初めてなので、何か間違ったことをしているだけだと思いますか?
[OK]を編集 して、間違ったキーパスを使用していた問題を見つけました。
私は今それをアニメートさせることができますが、それは奇妙に見えます:
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.scale.y"];
...
animation.fromValue = [NSNumber numberWithFloat:0.1];
animation.toValue = [NSNumber numberWithFloat:1];
私がやりたいのは、アニメーションを「スケールアップ」して、所定の位置に引き伸ばすことです。今のところ、それは私が望んでいるものではない中心から成長しているようなものです。それを達成する方法はありますか?