当UIScrollView滚动时,CADisplayLink停止更新 [英] CADisplayLink stops updating when UIScrollView scrolled
问题描述
标题是相当自我解释,但我有一些动画在由CADisplayLink触发的循环中完成。但是,一旦我滚动UIScrollView我已经添加到我的视图层次结构,动画立即停止,只有当滚动完全停止并停止时再次返回....
$ b
运行显示链接(使用 -addToRunLoop :forMode:
)在另一个线程与另一个运行循环。因此,创建一个新线程,在该线程上创建一个运行循环,并在该线程/运行循环上运行CADisplayLink。
Title is quite self explanatory, but I have some animation being done in a loop triggered by CADisplayLink. However, as soon as I scroll a UIScrollView I have added to my view hierarchy, the animation stops immediately, only to return again when scrolling has completely stopped and come to a standstill....
Anyway to cancel this behaviour?
Run the display link (using -addToRunLoop:forMode:
) on another thread with another run loop. So create a new thread, create a run loop on that thread, and run the CADisplayLink on that thread/run loop.
这篇关于当UIScrollView滚动时,CADisplayLink停止更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!