简体   繁体   English

android如何通过MotionEvent ev)

[英]How will android pass the MotionEvent ev)

In my custom view, I over-ride 在我的自定义视图中,我优先

public boolean onInterceptTouchEvent(MotionEvent ev);

to return false in some motion event, 在某些运动事件中返回false

But I want to ask another view to handle it, how can I 'forward this MotionEvent to the another view? 但是我想问另一个视图来处理它,如何将这个MotionEvent转发给另一个视图?

Thank you. 谢谢。

returning false from onInterceptTouch event passes the touch event down to a ViewGroup 's children, returning true keeps it for the ViewGroup itself. 从onInterceptTouch事件返回false会将touch事件向下传递给ViewGroup的子级,返回true则将其保留给ViewGroup本身。 See the docs , their explanation for this is very detailed. 请参阅文档 ,对此的解释非常详细。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM