1

enter image description here

In this picture you can see shadow of toolbar, i want to remove this shadow.

<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <com.google.android.material.appbar.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/Theme.AIT.AppBarOverlay">

        <androidx.appcompat.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="#2398f4"
            app:popupTheme="@style/Theme.AIT.PopupOverlay"
            app:elevation="0dp"/>

    </com.google.android.material.appbar.AppBarLayout>

    <include layout="@layout/content_main" />

</androidx.coordinatorlayout.widget.CoordinatorLayout>

here is xml file of toolbar.Also please tell me how to set This Home title to center.

Buddy
  • 581
  • 2
  • 11

1 Answers1

2

set the elevation to 0dp in toolbar xml.

// This is alternative method also you can implement ((AppCompatActivity)getActivity()).getSupportActionBar().setElevation(0); in main java file

buddy1
  • 36
  • 3