Remove actionbar shadow - varshaAv/Android-Tutorials GitHub Wiki

Hello friends, in this tutorial we will see "How to remove Actionbar shadow"...no matter if you are using a ActionBar or a ToolBar.

To remove the shadow shown in the above picture we just need to add a single line in our code.

app:elevation="0dp"

If you are using AppBarLayout the add this line in <AppBarLayout..../>

otherwise, in <Toolbar../>

suppose you are using AppBarLayout then your code will look like this:

<android.support.design.widget.AppBarLayout
      android:layout_height="wrap_content"
      android:layout_width="match_parent"
      app:elevation="0dp"
      android:theme="@style/AppTheme.AppBarOverlay">
      .....
</android.support.design.widget.AppBarLayout>  

and suppose you are using Toolbar then your code will look like this:

<android.support.v7.widget.Toolbar
      android:id="@+id/toolbar"
      app:elevation"0dp"
      android:layout_width="match_parent"
      android:layout_height="?attr/actionBarSize"
      android:background="?attr/colorPrimary"
      app:popupTheme="@style/AppTheme.PopupOverlay" />
⚠️ **GitHub.com Fallback** ⚠️