In my app I am using a toolbar and it seems there are borders around it that I'd like to get rid of :
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.
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.
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!
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.
I tried it by without AppBarLayout, and it's working. Don't use AppBarLayout, just use Toolbar as it is.
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">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With