How to make my toolbar background transparent in Android?

3.6k Views Asked by At

So i'm using a v7.toolbar and for some reason the toolbar seems to be having a grey color,i've already tried making the backgroundcolor/backgroundtint to Transparent,also tried setting alpha to 0,but it doesn't seem to work

 <android.support.design.widget.AppBarLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:elevation="0dp"
    android:backgroundTint="@color/colorTransparent"
    android:theme="@style/AppTheme.AppBarOverlay"
    android:background="@color/colorTransparent">
    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        app:elevation="0dp"
        android:backgroundTint="@color/colorTransparent"
        app:popupTheme="@style/AppTheme.PopupOverlay"
        android:background="@color/colorTransparent" />

</android.support.design.widget.AppBarLayout>

BTW,colorTransparent is also Transparent,tried @android:color to transparent as well(EDit:Added appbar as well)

any inputs would be helpful

1

There are 1 best solutions below

1
On

Try this code. Hope it will help you. Working fine in my case.

<android.support.v7.widget.Toolbar
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:background="@android:color/transparent"
    app:popupTheme="@style/AppTheme.PopupOverlay"
    app:theme="@style/AppTheme"/>