1

I want my AppCompat toolbar to be transparent with zero elevation.

Adding the android:background attribute makes the toolbar transparent, but adding app:elevation attribute just makes the toolbar disappear completely; the up-button and title disappear, and if the background is red or some other solid color, that color also disappears.

Any idea why?

Here is my AppBar

<android.support.design.widget.AppBarLayout
    android:id="@+id/appbar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
    android:background="@android:color/transparent"
    app:elevation="0dp"
    >

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        app:layout_collapseMode="pin"
        app:popupTheme="@style/ThemeOverlay.AppCompat.Light"


        />

</android.support.design.widget.AppBarLayout>
the_prole
  • 8,275
  • 16
  • 78
  • 163

1 Answers1

3

you just have to write findViewById(R.id.appBar).bringToFront(); in java file. Hope it helps you?

Sandeep Manmode
  • 395
  • 4
  • 15