[英]iOS UIView Animation Issue
在UITabBarController中切換頁面時,我遇到了UIView動畫的問題。
UIViewControllerA中的視圖正在播放以下動畫: -
[UIView animateWithDuration:1.0 delay:0.0 options:UIViewAnimationOptionRepeat | UIViewAnimationOptionCurveLinear | UIViewAnimationOptionBeginFromCurrentState animations:^{
CGAffineTransform transform = CGAffineTransformMakeRotation(M_PI);
self.animationImageView.transform = transform;
} completion:NULL];
動畫是一個自定義加載輪,在加載歌曲時停止。
如果我在頁面之間切換,即從UIViewControllerA切換到UIViewControllerB,然后在UITabController中返回到A,則動畫停止。 當我嘗試重新啟動它時,它不再動畫。
答案很簡單,重置轉換:
self.animationImageView.transform = CGAffineTransformIdentity;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.