How to remove button shadow (android) How to remove button shadow (android) android android

How to remove button shadow (android)


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

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


A simpler way to do is adding this tag to your button:

android:stateListAnimator="@null"

though it requires API level 21 or more..


Kotlin

stateListAnimator = null

Java

setStateListAnimator(null);

XML

android:stateListAnimator="@null"