1
たとえば、風景の状態でアニメーションを使用し、ステータスAからBまでの継続時間は5.0秒です。 5.0sの途中でiPadを風景から肖像画に回転させることができます。アニメーションを停止し、回転させた後にUIステータスをCにします。回転時にアニメーションを中断/停止できますか?
私の質問は明確ではありません。 どうすればいいですか?
私のアニメーションコード:
- (void)moveImage:(UIImageView *)image duration:(NSTimeInterval)duration x:(NSNumber*)dx y:(NSNumber*)dy
{
// Setup the animation
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:duration];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationBeginsFromCurrentState:YES];
// The transform matrix
float fx = [dx floatValue];
float fy = [dy floatValue];
CGAffineTransform transform = CGAffineTransformMakeTranslation(fx, fy);
//CGAffineTransform transform = CGAffineTransformMakeRotation(0.4);
//CGAffineTransform transform = CGAffineTransformMakeScale(2.0, 2.0);
image.transform = transform;
// Commit the changes
[UIView commitAnimations];
}
から私はあなたの問題はXcodeのではなくiOS版とは何の関係もないように、タグ&単語のXcodeを削除するには、あなたの質問を編集しています。あなた自身の質問をもう一度編集して、アニメーションをどのようにしているかを示すコードを少し追加できますか?アニメーションを行うにはいくつかの方法がありますので、役に立つ答えは実装によって異なります。ありがとう! –