问题描述
我有一个 HorizontalScrollView
在 ViewPager
,我已经禁用的观点寻呼机的ontouchevent,但问题是水平滚动视图受此干扰。它不能正常工作,仅移动了一点。
I have a HorizontalScrollView
inside a ViewPager
, I have disabled the ontouchevent of the view pager, but the problem is horizontal scroll view is disturbed by this. It doesn't work properly, only moves a little.
我只是想了解触摸监听功能, onInterceptTouchEvent
和的TouchEvent
的父母和孩子的看法,有什么是为了他们的呼召,如果我在子视图触摸?
I just want to understand the touch listeners functionality , onInterceptTouchEvent
and touchEvent
of the parent and child view, what is the order their calling if i touch on a child view?
推荐答案
的TouchEvent首先由儿童观来处理,如果不处理它,这意味着返回false,父视图将会处理它。但onIterceptTouchEvent是之前的TouchEvent
touchEvent is first be handled by child View , if it doesn't handle it ,which means return false,the parent view will handle it. But onIterceptTouchEvent is before touchEvent.
这篇关于触摸听众的亲子观的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!