- 右键res–>New–>Android resourse file
注意Root element 是不能选择的 是直接填写为shape, 默认应该是selector 把它改为shape即可
button_circle_shape.xml 内容如下
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<corners android:radius="0dp" /> <!-- 设置圆角弧度 -->
<solid android:color="#01FF05" /> <!-- 设置背景颜色 -->
<size
android:width="40dp"
android:height="40dp" />
<stroke
android:width="0dp"
android:color="#fff" />
</shape>
给button的background属性赋值
android:background="@drawable/btn_circle_shape"