0

I wanted to implement shadow to FloatingActionButton. I saw some solution saying to add app:borderWidth="0dp", but that didn't work for me.
I couldn't find any solution to add shadow to the button.

This is my FloatingActionButton:

 <android.support.design.widget.FloatingActionButton
    android:id="@+id/fab"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="end"
    android:layout_marginBottom="16dp"
    android:layout_marginEnd="16dp"
    app:backgroundTint="@color/colorFab"
    app:borderWidth="0dp"
    app:elevation="6dp"
    app:fabSize="normal"
    app:pressedTranslationZ="12dp" />

How can I implement shadow to this FloatingActionButton?

Thanks in advance.

Oliver
  • 853
  • 1
  • 11
  • 27
Siva Perumal
  • 377
  • 1
  • 7
  • 21

1 Answers1

0

For shadow, you just need to the required app:elevation="10dp" I've set 10dp you can check the shadow effect will increase.

Pratik Butani
  • 56,749
  • 54
  • 254
  • 407
Neha Chauhan
  • 592
  • 3
  • 12