shape drabwable
可以绘制图形的一种资源,一般定义在xml中,然后置于res/drawable目录下。在做控件的背景时,不需要图片就能通过shape构建出样式多种的背景。
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape=["rectangle" | "oval" | "line" | "ring"] > <corners<!-- 只有在shape为rectangle时使用,以下参数取值必须大于1--> android:radius="统一四个圆角设置,这个可以被以下任何一个覆盖对应的角落做单独角落处理" android:topLeftRadius="integer" android:topRightRadius="integer" android:bottomLeftRadius="integer" android:bottomRightRadius="integer" /> <gradient android:angle="渐变方向,0为从左至右,90为从下至上,逆时针方向旋转," android:centerX="渐变色中心的X相对位置(0-1.0)" android:centerY="