代码实现圆角背景

在drawable文件夹中创建一个.xml文件

<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/white"/> <!-- 设置框内背景颜色 -->
<corners android:radius="8dp"/> <!-- 设置边角弧度的大小 -->
<stroke android:color="@color/line_grey" android:width="1dp"/> <!-- 设置边框颜色以及边框的宽度 -->
</shape>
原文地址:https://www.cnblogs.com/done-dyj/p/8868410.html