I left the toolbar transparent but would like to remove that shadow that highlights it.
Thanks to all who help ^^
I left the toolbar transparent but would like to remove that shadow that highlights it.
Thanks to all who help ^^
If you are using a structure similar to this one to implement your Toolbar
:
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
...>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
.../>
</android.support.design.widget.AppBarLayout>
The shadow that is appearing is not of Toolbar
, but of AppBarLayout
. To solve this, in its AppBarLayout
put the properties android:elevation="0dp"
and app:elevation="0dp"
the code would look like this:
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="0dp"
app:elevation="0dp"
...>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
.../>
</android.support.design.widget.AppBarLayout>
Two things could have happened: 1- You are not creating your theme from one that is NoActionbar so by default it will appear as an Actionbar regardless of whether or not the shadow will appear. The first step will be to check if the parent to your theme is Theme.AppCompat.NoActionBar or etc. 2 - If everything is right in 1, the moment you define the attributes of your toolbar as text etc do not call the SetSupportActionBar (Toolbar) method