【问题标题】:Scrolling stops animations iOS滚动停止动画 iOS
【发布时间】:2013-08-09 13:45:16
【问题描述】:

我的问题很简单,在我的 UIVIewController 上我有一个自定义 UIView,它使用 CAAnimation 和 UIViewAnimation 进行动画处理,我还有一个 UIScrollView,当 scrollView 滚动动画 UIView 时停止所有动画!

timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self 

selector:@selector(updateClock:) userInfo:nil repeats:YES];
hourHand.transform = CATransform3DMakeRotation (hourAngle+M_PI, 0, 0, 1);
...

在动画视图中我使用:NSTimer、QuartzCore 和 UIViewAnimation。

如何避免这种情况?这是因为我使用自定义 UIView 吗? (我还是个初学者)

谢谢大家!

【问题讨论】:

    标签: ios uiscrollview uiviewanimation caanimation


    【解决方案1】:

    您可能对这个 SO 问题感兴趣。 UIScrollView scroll event blocks UIView animation

    建议的解决方案是将timer 添加到当前循环中。

    [[NSRunLoop currentRunLoop] addTimer:timer forMode:NSRunLoopCommonModes];
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-09-16
    • 2021-01-17
    • 2015-01-15
    • 2021-10-30
    • 2016-03-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多