0
画面全体でラベルをアニメーション化しようとしていますが、正しく動作しないようです。現在、ビューを他のビューにアニメーション表示します。値とのアニメーション
また、必要に応じてアニメーションを「停止」できません。私は音楽プレーヤーでUIViewのトラック名をスクロールするために使用しています.NextまたはPrevをタップすると、アニメーションの途中で停止してからやり直す必要があります。
- (void)startAnimation {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:10];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(animationDidStop:)];
CGRect frame = trackName.frame;
frame.origin.x = -50;
trackName.frame = frame;
[UIView commitAnimations];
}
- (void)animationDidStop:(id)sender {
NSLog(@"animationDidStop");
CGRect frame = trackName.frame;
frame.origin.x = 194;
trackName.frame = frame;
[self startAnimation];
}