4
votes

I have a Android Button that I'm placing on my screen, and am defining a custom background drawable that just specifies a green rectangle for now. But, for some reason there appears to be a very thin shadow being drawn under my button (highlighted with the red box):enter image description here

Is there any way to get rid of this while still using a Button? It because really ugly when I change my background drawable to have rounded corners.

Thanks!

2
Let's see the really ugly. By the way, are you using Lollipop and/or a Material theme?Phantômaxx
Set style to ?android:attr/borderlessButtonStyle and tweak from there?JASON G PETERSON
On Material you need to set android:stateListAnimator="@null" to remove the default elevation animator. Alternatively, just use View if you don't want the default Button styling.alanv

2 Answers

9
votes

@alanv's comment was the correct answer: "On Material you need to set android:stateListAnimator="@null" to remove the default elevation animator. Alternatively, just use View if you don't want the default Button styling"

2
votes

Please try this.

style="?android:attr/borderlessButtonStyle"