Search code examples
androidbordertoolbarandroid-toolbar

How to remove the border around the toolbar?


In my app I am using a toolbar and it seems there are borders around it that I'd like to get rid of : enter image description here

and I created it like that :

<android.support.design.widget.AppBarLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/transparent">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:layout_gravity="center"
        android:minHeight="?attr/actionBarSize"/>

    </android.support.design.widget.AppBarLayout>

</android.support.design.widget.CoordinatorLayout>

and I use it like that :

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <include
        layout="@layout/app_bar_main_light"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />
</LinearLayout>

And I never found an attribute or styling specifying what is this border.


Solution

  • I tried it by without AppBarLayout, and it's working. Don't use AppBarLayout, just use Toolbar as it is.