首先在drawable目录下新建一个xml文件,命名为buttonshape
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
android:shape="rectangle">
<solid android:color="#CCB2DB82"/> <!--填充颜色-->
<!--圆角度-->
<corners
android:topLeftRadius="8dip"
android:topRightRadius="8dip"
android:bottomLeftRadius="8dip"
android:bottomRightRadius="8dip"
/>
</shape>
然后,将按钮的background设置为该xml文件即可