我在活动中添加了一个透明工具栏,该工具栏正常工作。问题是我想单击工具栏下的一个元素。尽管元素是可见的(因为工具栏是透明的),但我无法点击该元素,因为事件正在被工具栏捕获。 我该如何解决这个问题?Android可单击的透明工具栏
XML代码我已经是:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"/>
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/Theme.Transparent"
android:layout_height="@dimen/topbar"
android:layout_width="match_parent"
android:background="?attr/colorPrimary"
android:layout_alignParentTop="true" />
</RelativeLayout>
正如我所说的,它显示在工具栏上透明的片段,但我不能点击它是工具栏下的元素上。
在此先感谢!
我试过了,但它不工作。感谢您的回答! – FVod
@MateusBrandao我不认为这就是@FVod正在寻找的东西。他说他想在“工具栏”下捕捉点击事件。他从来没有提到过“片段”或菜单项。 – Heinrich
哦,我现在看到... –