【发布时间】:2016-10-20 20:34:37
【问题描述】:
我尝试在 Andorid 中移除 Button 的板。
我知道在设计中我可以改变它: style="?android:attr/borderlessButtonStyle"
但是如何在 Java 代码中更改它,或者 style.xml 中是否有灵魂?
【问题讨论】:
-
可能是 this 是您正在搜索的内容。
我尝试在 Andorid 中移除 Button 的板。
我知道在设计中我可以改变它: style="?android:attr/borderlessButtonStyle"
但是如何在 Java 代码中更改它,或者 style.xml 中是否有灵魂?
【问题讨论】:
试试这个
<Button
android:background="@drawable/shape"
android:layout_width="match_parent"
android:layout_height="wrap_parent" />
这里是 shape.xml 文件代码:
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke android:width="1dp" android:color="#1B5E20" />
<corners android:radius="2dp"/>
<padding android:left="0dip" android:top="0dip" android:right="0dip" android:bottom="0dip" />
</shape>
随心所欲地改变形状颜色属性..
【讨论】: