I’m trying to change the drop shadow of the text in a button and I can’t get it working.
I want to change the color based on the state of the button. I tried using a color selector for the shadow color but it crashed the app. It didn’t seem to want to use a selector for that attribute. So, now I am trying to do it at run time using
button.setShadowLayer(1, 1, 1, android.R.color.black);
However, it doesn’t change anything at all.
How can I get this to work?
Thanks much
This method is used to change the shadow on the text contained inside the button (also, you should bass android.R.color.black directly, it’s the ID of the black color, not the color itself, see the Resources class for more info.)