SPTween freezes when dragging/zooming a view inside UIScrollView

心不动则不痛 提交于 2019-12-25 08:19:26

问题


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.

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

CADisplayLink OpenGL rendering breaks UIScrollView behaviour

Animation in OpenGL ES view freezes when UIScrollView is dragged on iPhone

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.

View full size


回答1:


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.

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



来源:https://stackoverflow.com/questions/9512706/sptween-freezes-when-dragging-zooming-a-view-inside-uiscrollview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!