0

UIPanGestureRecognizerを使用して、ユーザーが描いたパスに沿ってオブジェクトを移動します。しかし、このオブジェクトはアニメーション化されており、アニメーション中にそれを操作する必要があります。出来ますか?私はすでに使用しようとしましUIViewAnimationOptionAllowUserInteractionたが、結果がありません。

4

1 に答える 1

0

はい、可能です。ただしCABasicAnimation、オブジェクトではなくオブジェクトのアニメーション化に使用し、オブジェクトにUIView animationWith...を追加しUIPanGestureRecognizerます。したがって、いくつかのサンプルコード:

// Configure the animation and add it to the layer.
CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:@"position"];
anim.fromValue = ...
anim.duration = ...
[view.layer addAnimation:anim forKey:@"some key"];
// Then add the UIPanGestureRecognizer to that view. 
于 2012-11-05T14:49:14.640 に答える