我正在對我的視圖執行動畫。但是我面臨的問題很少。我必須按鈕的startAnimation
和Stop Animation
。有關我的ImageView執行的動畫我正在使用startAnimation
按鈕的動作下面的代碼:UIView動畫的問題
UIViewAnimationOptions option = UIViewAnimationOptionRepeat + UIViewAnimationOptionAutoreverse;
[UIView animateWithDuration:2.5 delay:0.0 options:option
animations:^{
CGAffineTransform scale = CGAffineTransformMakeScale(2.0, 2.0);
CGAffineTransform translate = CGAffineTransformMakeTranslation(-50.0, -100.0);
CGAffineTransform mix = CGAffineTransformConcat(scale, translate);
imv.transform = mix;
}
completion:^(BOOL finished) {
}
];
這是工作。 現在我面臨的問題是:
- 如何阻止我stopAnimation按鈕操作這個動畫?
- 如果ImageView是動畫,然後我在後臺進入後臺,我再次進入前景ImageView粘在那裏,不會動畫。
如何解決這些問題?
你想「停止「按鈕將圖像恢復到原始位置或暫停動畫到位? –
當你重新輸入你的應用程序時,你是否期望視圖在你離開或從一開始就從原來的位置開始動畫? –