记录一下xml设置各种背景,不然经常翻之前的代码,哈哈
1.设置圆角背景
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#fcfcfc" /> 背景颜色
<corners android:radius="5dp"/> 圆角大小
//边框颜色和宽度,可选
<!--<stroke android:width="0.5dp" android:color="@color/colorPrimary" />-->
</shape>
2.设置圆形背景
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval"
android:useLevel="false">
<solid android:color="@color/white"/> 背景颜色
<stroke android:width="1.5dp" android:color="#ff2003" />