Search code examples
androidbuttonshadow

How to remove button shadow (android)


I want to remove the shadow from the button to make it seem more flat.

I have this right now:

cancel button with shadow

But I want this:

cancel button without shadow


Solution

  • Another alternative is to add

    style="?android:attr/borderlessButtonStyle"
    

    to your Button xml as documented here http://developer.android.com/guide/topics/ui/controls/button.html

    An example would be

    <Button
    android:id="@+id/button_send"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/button_send"
    android:onClick="sendMessage"
    style="?android:attr/borderlessButtonStyle" />