我想去掉按钮上的阴影,使它看起来更平坦。
我现在有这样的想法:
但我想要的是:
发布于 2015-06-10 22:11:37
另一种方法是添加
style="?android:attr/borderlessButtonStyle"
添加到此处http://developer.android.com/guide/topics/ui/controls/button.html文档中的Button xml
一个例子就是
<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" />
发布于 2016-08-24 20:04:03
一种更简单的方法是将此标记添加到按钮:
android:stateListAnimator="@null"
尽管它需要API级别21或更高级别..
发布于 2016-06-24 11:01:15
我使用自定义样式
<style name="MyButtonStyle" parent="@style/Widget.AppCompat.Button.Borderless"></style>
别忘了添加
<item name="android:textAllCaps">false</item>
否则,按钮文本将为UpperCase格式。
https://stackoverflow.com/questions/28756035
复制相似问题