0
我試圖解決幾個星期的問題,但我找不到答案。 我試圖讓動畫結束時最後一幀凍結。凍結xcode圖像動畫的最後一幀
這是我的動畫代碼:
-(IBAction)play {
image.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"1.png"],
[UIImage imageNamed:@"2.png"],
[UIImage imageNamed:@"3.png"],
[UIImage imageNamed:@"4.png"],
[UIImage imageNamed:@"5.png"],
[UIImage imageNamed:@"6.png"],
[UIImage imageNamed:@"7.png"],
[UIImage imageNamed:@"8.png"],
[UIImage imageNamed:@"9.png"],
[UIImage imageNamed:@"10.png"],
[UIImage imageNamed:@"11.png"],
[UIImage imageNamed:@"12.png"],
[UIImage imageNamed:@"13.png"],nil];
[image setAnimationRepeatCount: 1];
image.animationDuration = 0.5;
[image startAnimating];
}
-(IBAction)stop{
[image stopAnimating];
}
當我按下按鈕播放,動畫運行,當我按下按鈕停止時,停止動畫和disapear圖像。
我喜歡做這個事情沒有停止按鈕,當動畫結束時,最後一幀是可見的。
謝謝你的幫助。
感謝我會盡力。 – nioan7