【发布时间】:2015-09-21 16:08:02
【问题描述】:
我在一个活动中添加了一个透明工具栏,它工作正常。问题是我想点击工具栏下的一个元素。尽管该元素是可见的(因为工具栏是透明的),但我无法单击该元素,因为该事件正在被工具栏捕获。 我该如何解决这种行为?
我的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>
正如我所说,它在片段上显示工具栏透明,但我无法单击工具栏下方的元素。
提前致谢!
【问题讨论】:
-
我试过了,但它不起作用。感谢您的回答!
-
@MateusBrandao 我认为这不是@FVod 正在寻找的。他说他想在
Toolbar下捕获点击事件。他从不谈论Fragments 或菜单项。
标签: android android-layout android-actionbar toolbar android-toolbar