6

I'm trying to set a shadow for my button, but instead of getting shadow for the whole button I'm getting it for button's text only.

I've tried both: using xml styles

<style name="shadowed_button">
    <item name="android:shadowColor">#444444</item>
    <item name="android:shadowDx">1</item>
    <item name="android:shadowDy">1</item>
    <item name="android:shadowRadius">9</item>
</style>

and setting shadow programmatically

button.setShadowLayer(9, 1, 1, Color.rgb(44, 44, 44));

Both work identically. Does anyone know how to do this?

Unkot
  • 84
  • 1
  • 1
  • 4

1 Answers1

1

To do so you have to make the image of the button with shadow and place on the button as drawable.

Neeraj Nama
  • 1,562
  • 1
  • 18
  • 24
  • 1
    Thanks. I've already thought about that. I was just curious if there are any other more elegant ways of doing that. – Unkot Jun 23 '11 at 15:21