1

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

cottonBallPaws
  • 21,220
  • 37
  • 123
  • 171

1 Answers1

4

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.)

Romain Guy
  • 97,993
  • 18
  • 219
  • 200