0

I am creating a app in which I need to drop shadow in app bar layout like this

enter image description here

but instead of that I am getting this:

enter image description here

Here is my code which I used

<com.google.android.material.appbar.AppBarLayout
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginStart="16dp"
    android:layout_marginTop="16dp"
    android:layout_marginEnd="16dp"
    android:backgroundTint="@color/colorPrimary"
    android:elevation="32dp"
    android:outlineProvider="bounds"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent">

    <Toolbar
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <EditText
            android:id="@+id/search_text"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="8dp"
            android:layout_marginEnd="8dp"
            android:autofillHints="no"
            android:backgroundTint="@color/colorPrimary"
            android:ems="10"
            android:hint="@string/search_text_hint"
            android:inputType="textPersonName"
            android:textColor="#DBFFFFFF"
            android:textColorHint="#D44A4A4B" />
    </Toolbar>


</com.google.android.material.appbar.AppBarLayout>
halfer
  • 19,824
  • 17
  • 99
  • 186

1 Answers1

0

In your code instead of android:elevation="32dp" use app:elevation="32dp".

arvind
  • 104
  • 4