2017-07-17 148 views

回答

0

試試這個

<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" /> 

現在創建一個資源background_toolbar.xml/drawble

<?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> 

現在設置你的工具欄

+0

@Nielsh Rathod,您的解決方案無法正常工作。奧基,再看看這裏。我有一個recyclerview的頁面,所以我想看看我的透明工具欄下的mine recyclerview。 – Vaniusha

+0

添加你全屏與quetion我沒有得到你 –

+0

再次檢查我的問題。我做了編輯 – Vaniusha

0

設置工具欄:

<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"/> 
相關問題