Dispatch touch event to child in custom viewgroup

好久不见. 提交于 2019-12-11 18:55:50

问题


Is there any way to dispatch touch event only to specific child in custom view group with stacked children.


回答1:


For as long as you have reference on both, the child you want to receive the event and the parent, you can implement the parent to pass the touch to the child you wish to receive it.

can you post the code of the View?

So you can make something like:

@Override
public boolean onTouchEvent(Event e){
  childToGetTheEvent.onTouchEvent(e);
}

Or is there any reason you cant do something like this?



来源:https://stackoverflow.com/questions/18845509/dispatch-touch-event-to-child-in-custom-viewgroup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!