在UIScrollView中滚动时未调用touchesBegan方法 [英] touchesBegan method not called when scrolling in UIScrollView

查看:132
本文介绍了在UIScrollView中滚动时未调用touchesBegan方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到,如果我立即将手指放在它上面并滚动,则不会在UIScrollView中调用touchesBegan方法。 touchesBegan只有在我滚动之前将手指放置一定时间后才会被调用。如果不是每当有对的UIScrollView触摸的touchesBegan总是叫什么名字?

I noticed touchesBegan method is not called in UIScrollView if i immediately place my finger on it and scroll. touchesBegan only gets called after i place my finger for a certain time duration before scrolling. Shouldn't touchesBegan always be called whenever there is a touch on the UIScrollView?

推荐答案

我相信的UIScrollView截获这些事件,确定是否要滚动包含视图的目的。实际上,看起来它首先得到它们(这与正常处理相反,最深的子视图首先获得它们),以便它可以判断是否存在滚动或捏合手势。见如何窃取的UIScrollView从接触它的子视图?

I believe that UIScrollView intercepts these events, for the purpose of figuring out if you are going to be scrolling the containing view. Actually, it looks like it gets them first (which is opposite normal processing, where the deepest subview gets them first) so that it can figure out if there is a scroll or pinch gesture. See How does UIScrollView steal touches from its subviews?

这篇关于在UIScrollView中滚动时未调用touchesBegan方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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