I am using Button
in a Service
class. The Button
is working fine. I just want to know how can I add some background shadow effects for button. Is it possible to add background shadow effect for button programmatically in android?
Asked
Active
Viewed 1,258 times
0

Mad Physicist
- 107,652
- 25
- 181
- 264

Adarsh
- 165
- 2
- 16
-
https://developer.android.com/training/material/shadows-clipping.html – Vishwesh Jainkuniya Aug 08 '16 at 14:31
-
Did you try http://stackoverflow.com/questions/15333529/how-to-provide-shadow-to-button – user1841702 Aug 08 '16 at 14:33
-
@user1841702 yaa I have already tried but it is not giving me good shadow effect – Adarsh Aug 08 '16 at 14:47
-
use `View#setBackground` with a `LayerDrawable` – pskink Aug 08 '16 at 14:52
-
@pskink layerDrawable means the drawable which contains shadow animation code? – Adarsh Aug 08 '16 at 15:01
-
animation? what animation? `LayerDrawable` should contain "real" button and the "shadow" in the second layer – pskink Aug 08 '16 at 15:06
-
OK thanks I got it:) – Adarsh Aug 08 '16 at 15:09