Remove elevation shadow without removing elevation itself

Jocky Doe picture Jocky Doe · Dec 9, 2017 · Viewed 9.4k times · Source

Is there a way for AppBarLayout to no drop shadow and keep its elevation?

<android.support.design.widget.AppBarLayout
        app:elevation="0dp">

Answer

Sean Blahovici picture Sean Blahovici · Feb 6, 2019

To complete M.Sandholtz answer, you can also define this in XML, with outlineProvider="none".

<View
    android:id="@+id/viewElevationNoShadow"
    android:outlineProvider="none"
    android:elevation="4dp"/>