'How to add shodows in android layout elements?

I want to add shodow to ConstraintLayout. Shadow parameters: blur: 10 color: #000000 colorAplpha 5%

I try by adding this code:

    android:shadowColor="@color/my_shadow_color"
    android:shadowDx="0"
    android:shadowDy="0"
    android:shadowRadius="10"

but it doesn't work!

How to do it ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source