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