Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 386
Axl Avatar asked Nov 17 '16 00:11

Axl


People also ask

How do I get rid of borders on my taskbar?

Open Settings in Windows 11. Click on Personalization. Click the Colors page on the right side. Turn off the Show accent color on title bars and windows borders toggle switch.

How do I get rid of the white border in Windows 10?

Click on Colors; Scroll down and disable the option "Show accent color on title bars and windows borders"; So the white border will be removed; I hope I have helped, see you soon!

How do I get rid of a border in Excel?

On the Page Layout tab, in the Page Background group, select Page Borders. In the Borders and Shading dialog box, on the Page Border tab, under Setting, choose None. Select OK.


2 Answers

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

like image 104
joyl Avatar answered Sep 20 '22 15:09

joyl


If @joyl answer works but still you do not wish to remove your AppBarLayout then set elevation to 0 in AppBarLayout like follows:

<com.google.android.material.appbar.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:elevation="0dp">
like image 41
Faisal Shaikh Avatar answered Sep 21 '22 15:09

Faisal Shaikh