Can't get rid of shadow under Android Button

痴心易碎 提交于 2019-12-10 06:18:21

问题


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):

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!


回答1:


@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:


Please try this.

style="?android:attr/borderlessButtonStyle"



来源:https://stackoverflow.com/questions/27408240/cant-get-rid-of-shadow-under-android-button

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!