I am not an expert, but I ran into the same problem just a few hours ago. So the idea is that with AppCompat we need to manage library attributes, not Android attributes. In other words, instead of android: elevation try app: elevation:
<android.support.design.widget.AppBarLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/appbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" android:fitsSystemWindows="true" app:elevation="0dp"> <android.support.v7.widget.Toolbar xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="match_parent" app:popupTheme="@style/ThemeOverlay.AppCompat.Light" /> </android.support.design.widget.AppBarLayout>
EDIT:
I just tried another option without AppBarLayout . This method works fine for me, the shadow has completely disappeared. Therefore, I suspect that the problem is in your other view. I don't think your ToolBar shadow casts a shadow.
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" app:popupTheme="@style/ThemeOverlay.AppCompat.Light" android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="?attr/actionBarSize" app:elevation="0dp" />
DmitryO. Jul 18 '15 at 15:40 2015-07-18 15:40
source share