How to remove button shadow (android)

sousheel picture sousheel · Feb 27, 2015 · Viewed 127.3k times · Source

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

Answer

Alt-Cat picture Alt-Cat · Jun 10, 2015

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" />