- 1、本人使用的是Android Studio开发的
- 2、在
src/main/res/drawable
包下新建一个shape
类型的文件 - 3、
src/main/res/drawable/et_shape.xml
文件代码
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#fff"/>
<stroke
android:width="1dp"
android:color="#ddd"/>
<corners android:radius="6dp"/>
</shape>
- 4、在需要使用圆角的地方加上
android:background="@drawable/et_shape"
就可以