android XML绘图

通过android:shape属性指定形状:rectangle,oval(椭圆),line,ring;

solid : 设置形状填充的颜色,只有android:color一个属性;

gradient : 设置形状的渐变颜色,可以是线性渐变、辐射渐变、扫描性渐变;
android:type 渐变的类型
     linear 线性渐变,默认的渐变类型
     radial 放射渐变,设置该项时,android:gradientRadius也必须设置
     sweep 扫描性渐变
android:startColor 渐变开始的颜色
android:endColor 渐变结束的颜色
android:centerColor 渐变中间的颜色
android:angle 渐变的角度,线性渐变时才有效,必须是 45 的倍数, 0 表示从左到右, 90 表示从下到上
android:centerX 渐变中心的相对X坐标,放射渐变时才有效,在 0.0 1.0 之间,默认为 0.5 ,表示在正中间
android:centerY 渐变中心的相对X坐标,放射渐变时才有效,在 0.0 1.0 之间,默认为 0.5 ,表示在正中间
android:gradientRadius 渐变的半径,只有渐变类型为radial时才使用
android:useLevel 如果为 true ,则可在LevelListDrawable中使用      

corners
: 设置圆角,只适用于rectangle类型  
android:radius 圆角半径,会被下面每个特定的圆角属性重写
android:topLeftRadius 左上角的半径
android:topRightRadius 右上角的半径
android:bottomLeftRadius 左下角的半径
android:bottomRightRadius 右下角的半径

stroke : 设置描边,可描成实线或虚线
android:color 描边的颜色
android:width 描边的宽度
android:dashWidth 设置虚线时的横线长度
  android:dashGap 设置虚线时的横线之间的距离  
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值