1.在drawable 中新建一个xml文件 命名为 bolder.xml
内容如下:
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" > <stroke android:width="0.01dp" android:color="#C6C7CE" /> <padding android:bottom="0dp" android:top="0dp" android:left="0dp" android:right="0dp" /> </shape>距离父类的距离可自行修改值
2. 在使用的地方,添加LinearLayout 的背景
android:background="@drawable/bolder"
3.如果需要不同的颜色背景,恩,分类写多个xml文件