Android 如何使用非透明工具栏项创建透明工具栏
如何使用可见的工具栏项创建透明的自定义工具栏? 我有一个带有recycler视图的页面,我想在我的透明工具栏下看到我的recyclerview,其中包含可见的工具栏项。 它应该看起来像这样设置工具栏:Android 如何使用非透明工具栏项创建透明工具栏,android,android-toolbar,toolbaritems,Android,Android Toolbar,Toolbaritems,如何使用可见的工具栏项创建透明的自定义工具栏? 我有一个带有recycler视图的页面,我想在我的透明工具栏下看到我的recyclerview,其中包含可见的工具栏项。 它应该看起来像这样设置工具栏: <android.support.v7.widget.Toolbar android:id="@+id/tbsobre" android:layout_width="match_parent" android:layout_height="?a
<android.support.v7.widget.Toolbar
android:id="@+id/tbsobre"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@android:color/transparent"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/>
试试这个
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@drawable/background_toolbar" />
现在在res/drawble中创建一个background_toolbar.xml
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="270"
android:endColor="@android:color/transparent"
android:startColor="#66000000"/>
</shape>
现在设置您的工具栏@Nielsh Rathod,您的解决方案没有按我所希望的那样工作。好的,再看看这里。我有一个带有recyclerview的页面,所以我想在我的透明工具栏下查看我的recyclerview。使用quetion全屏添加你我没有得到你得到它。谢谢!最受欢迎@Vaniusha