0
我試圖在屏幕上爲標籤製作動畫,但我似乎無法正常工作。目前它激發了對其他觀點的看法。往返於動畫的動畫
另外我不能在需要時「停止」動畫。我在音樂播放器中使用它在UIView上滾動曲目名稱,當我點擊下一個或上一個時,它必須停止中間動畫並重新開始。
- (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];
}