在 UITabBarController 中的页面之间切换时,我遇到了 UIView 动画问题。
UIViewControllerA 中的 View 正在播放以下动画:-
[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;
关于iphone - iOS UIView 动画问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8489638/