1.一般在drawable文件夹下新建文件translucent.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 背景颜色 -->
<solid android:color="#33CCFF" />
<!-- 边框的宽度和颜色颜色 -->
<stroke android:width="1dip" android:color="#33CCFF" />
<!-- android:radius 弧形的半径 -->
<corners android:radius="20dp"/>
<!-- padding:Button里面的文字与Button边界的间隔 -->
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp"
/>
/>
</shape>
2.使用translucent.xml
<Button
android:id="@+id/button1"
android:layout_width="100dp"
android:layout_height="50dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="10dp"
android:text="按钮"
android:background="@drawable/translucent"/>
使用之后,这个button按钮的背景就是弧形的样式了