iOS UIViewanimation问题
在UITabBarController中切换页面时遇到UIViewanimation问题。
UIViewControllerA中的视图正在播放以下animation:
[UIView animateWithDuration:1.0 delay:0.0 options:UIViewAnimationOptionRepeat | UIViewAnimationOptionCurveLinear | UIViewAnimationOptionBeginFromCurrentState animations:^{ CGAffineTransform transform = CGAffineTransformMakeRotation(M_PI); self.animationImageView.transform = transform; } completion:NULL];
该animation是一个自定义加载轮,当一首歌曲已经加载时停止。
如果我在页面之间切换,即从UIViewControllerA到UIViewControllerB,然后在UITabController中返回到A,则animation停止。 当我尝试重新启动它时,它不再animation。
答案很简单,重置转换:
self.animationImageView.transform = CGAffineTransformIdentity;