将触摸传递到下面的视图 [英] Pass touches to the view under

查看:26
本文介绍了将触摸传递到下面的视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我在活动顶部有一个片段.该片段填满了整个屏幕.片段的一部分是一个透明的视图,您可以看到下面的视图(属于活动).有没有办法将触摸事件传输到片段透明视图下的视图?谢谢!

In my app I have a fragment on top of the activity. The fragment is filling the whole screen. Part of the fragment is a transparent View and you can see the views under (that belong to the activity). Is there a way to transfer the touch events to the views that are under the transparent View of the fragment? Thanks!

推荐答案

在你重写的 onTouchEvent 方法里面的片段返回 false,它将触摸事件传递给下层图层视图.

In your overriden onTouchEvent method inside the fragment return false, it passes the touch event to the lower layer views.

这篇关于将触摸传递到下面的视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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