触摸听众的亲子观 [英] Touch Listeners for Parent and Child Views

查看:105
本文介绍了触摸听众的亲子观的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Horizo​​ntalScrollView 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.

这篇关于触摸听众的亲子观的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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