在Android 5.0以后的版本中,定义一个button时,系统自动会加一个阴影的效果,需要手动去掉阴影则可以按如下方式处理。
<Button android:layout_width="match_parent" android:layout_height="@dimen/dp_30" style="@style/ButtonNoShadowStyle" />
<style name="ButtonNoShadowStyle" parent="@style/Widget.AppCompat.Button.Borderless"> </style>
parent="@style/Widget.AppCompat.Button.Borderless",加上这句话阴影就消失了