您的位置:首页 > 移动开发 > Android开发

Android中的shape

2016-09-25 15:52 190 查看
调用方法:android:background="@drawable/shape"

solid:实心,就是填充的意思

gradient:渐变

android:angle是渐变角度,必须为45的整数倍。左边是零度。

可以指定渐变为径向渐变,android:type="radial",径向渐变需要指定半径android:gradientradius="50"。

stroke:描边

android:width="2dp" 描边的宽度,android:color 描边的颜色。

还可以把描边弄成虚线的形式,设置方式为:

android:dashwidth="5dp"

android:dashgap="3dp"

其中android:dashwidth表示'-'这样一个横线的宽度,

android:dashgap表示之间隔开的距离。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: