在UIScrollView中拖动/缩放视图时,SPTween冻结 [英] SPTween freezes when dragging/zooming a view inside UIScrollView

查看:126
本文介绍了在UIScrollView中拖动/缩放视图时,SPTween冻结的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Sparrow框架.我一直在使用SPTween和SXParticleSystem来移动精灵.问题是当我在UIScrollView中移动视图或调整视图大小时,那些补间和粒子会冻结.当我结束拖动时,精灵将再次移动,而不是从其冻结的位置开始移动,但是如果没有冻结,它们将从应该移动的位置移动.如何将这些精灵与其他带有动画效果的UIKit元素一起进行动画处理.

I am using Sparrow framework. I have been playing with moving sprites around using SPTween and SXParticleSystem. The problem is when I move or resize a view inside UIScrollView, those tween and particles just freeze. When I end dragging, the sprite moves again, not from where it froze but they move from where they should be if it weren't frozen. How can animate those sprites along side with other animating UIKit elements.

我确实尝试使用CoreAnimation(UIView动画)并拖动scrollview.它不会冻结.有什么想法吗?

I did try to use CoreAnimation (UIView animation) and drag the scrollview. It doesn't freeze. Any ideas?

CADisplayLink OpenGL渲染中断了UIScrollView行为

OpenGL ES视图中的动画在iPhone上拖动UIScrollView时冻结

我在上面看到过类似的文章,他们建议移动滚动视图会将runLoopMode更改为OpenGL通常不使用的模式.但是我仍然不知道如何在Sparrow框架中更改runLoops.

I have seen these similar post above and they suggest that the moving the scrollview changes the runLoopMode to one that OpenGL doesn't normally use. But I still don't know how to change the runLoops in Sparrow framework.

查看完整大小

推荐答案

找到解决方案.在SPView.m行中,将NSDefaultRunLoopMode更改为NSRunLoopCommonModes.原因是Sparrow中的默认OpenGL渲染是使用NSDefaultRunLoopMode注册的,该模式将在某些情况下(例如,UI更新)停止运行.有关更多信息,请阅读下面的链接.

Solution found. In SPView.m line , change NSDefaultRunLoopMode to NSRunLoopCommonModes. The reason is the default OpenGL rendering in Sparrow is registered using NSDefaultRunLoopMode, which that mode will stop running in some circumstances such as a UI update. For more info, please read the link below.

什么是运行循环?我们可以使用哪些模式? https://stackoverflow.com/a/7223765/467588

What are runloops and what modes can we use? https://stackoverflow.com/a/7223765/467588

这篇关于在UIScrollView中拖动/缩放视图时,SPTween冻结的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆