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
  • 926
  • 2
  • 12
  • 31
Siva Perumal
  • 457
  • 2
  • 8
  • 23

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
  • 60,504
  • 58
  • 273
  • 437
Neha Chauhan
  • 622
  • 4
  • 12