今天在看SDK文档的时候发现了一个很是奇怪的布局文件,里边是有关shape布局的xml文件,霎时间不知道这是什么东东,因此开始了狂搜SDK的开发指南,又从网上找了一大圈,终于是把shape的布局方式KO掉了,google真是强大啊,下面是sdk中的shape布局代码,我们慢慢KO之
solid android:color=“” //使用这种颜色全部实心填充
stroke 描边
android:width=“1dp” color=“#ff000000” 边的颜色是#ff000000,宽度为1dp
padding 间隔 距离上下左右边框的距离为1dp
在开发的过程中你还会用到
gradient 此属性控制布局的渐变颜色
如<gradient android:startColor="#ff0000"
android:endColor="#ffffff" 设置渐变颜色,从#ff0000渐变到#ffffff
android:angle="90" 设置渐变角度必须为45度得整数倍
android:type="linear" 将渐变模式设置成线性模式
>
corners 属性设置边角角度
<corners
android:topRightRadius="20dp" 右上角
android:bottomLeftRadius="20dp" 右下角
android:topLeftRadius="1dp" 左上角
android:bottomRightRadius="0dp" 左下角
>