androidandroid-toolbartoolbaritems

How to make transparent toolbar with not transparent toolbar items


how i can to make transparent custom toolbar with visible toolbar items? I have a page with recycler view and I want to see my recyclerview under mine transparent toolbar with visible toolbar items. It's should looks like this


Solution

  • try this

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

    now create a background_toolbar.xml in res/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>
    

    now set your toolbar