拿Textview举例
1.先在drawable里面新建一个xml文件,具体信息如下
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="#F5F5F5" /> //边框内部的背景颜色
<stroke
android:width="1dp" //边框的宽度
android:color="#C3C3C3" /> //边框的颜色
<corners
android:bottomLeftRadius="5dp"
android:bottomRightRadius="5dp"
android:topLeftRadius="5dp"
android:topRightRadius="5dp" /> //边框的圆角弧度
</shape>
2.然后在Textview控件里面调用即可
<TextView
android:layout_width="100dp"
android:layout_height="30dp"
android:background="@drawable/aixin_tablelayout" //这里是调用的上面写的文件
android:text="任务名称"/>