触摸事件延迟 [英] Delay with touch events
问题描述
我们在AppStore中有一个应用程式 Bust〜A〜Spook 我们遇到了问题。当点击屏幕时,我们使用CALayer在动画期间查找所有视图的位置,如果你打开一个,我们开始一个模具序列。然而,有一个明显的延迟,看起来好像触摸被缓冲,我们我们收到事件迟到。有没有一种方法来轮询或任何更好的方式来响应触摸,以避免这个滞后时间?
We have an app in AppStore Bust~A~Spook we had an issue with. When you tap the screen we use CALayer to find the position of all the views during their animation and if you hit one we start a die sequence. However, there is a noticeable delay, it appears as if the touches are buffered and we we receive the event to late. Is there a way to poll or any better way to respond to touches to avoid this lag time?
这是在UIView而不是UIScrollView
This is in a UIView not a UIScrollView
推荐答案
您是否使用UIScrollView来托管所有这些?有一个属性叫delayedcontentTouches。这默认为YES,这意味着视图尝试在传递之前确定触摸是否是滚动手势。您可以尝试将此设置为NO,然后查看是否有帮助。
Are you using a UIScrollView to host all this? There's a property of that called delaysContentTouches. This defaults to YES, which means the view tries to ascertain whether a touch is a scroll gesture or not, before passing it on. You might try setting this to NO and seeing if that helps.
这篇关于触摸事件延迟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!