首先要在values目录下新建attrs的xml文件,文件里面是这样写的
其中format的属性值包括:reference,color,boolean,dimension,float,integer,string,fraction,enum等
1.reference
reference是引用类型,就比如引用资源id,R.drawable.xxx
2.color
color是颜色值,比如#ff00cc等
3.boolean 布尔值,true或者false
4.dimension
dimension是尺寸值,比如我们设置的latout_width所设置的值
5.float是浮点型
6.integer是整形
7.string是字符串
8.enum 是枚举值,暂时不清楚,稍后补充
9.fraction是百分数