【样式】shape属性详细

1、属性

<shape>
     <!-- 实心,即填充颜色-->
     <solid android:color="#ff9d77"/>
     <!-- 渐变 -->
     <!-- 线性渐变 android:type="linear",是默认的模式 -->
     <!-- 径向渐变 android:type="radial",需要指定半径android:gradientRadius="50" -->

     <gradient
          android:startColor="#ff8c00"   <!-- 起始颜色 -->   
          android:endColor="#FFFFFF"   <!-- 结束颜色 -->
          android:angle="270" />   <!-- 渐变角度,必须是45度的整数倍 -->

     <!-- 实线描边 -->
     <stroke
          android:width="2dp"   <!-- 描边宽度 -->  
          android:color="#dcdcdc" />   <!-- 起始颜色 --> 
     <!-- 虚线描边 -->
     <stroke
          android:dashWidth="5dp"   <!-- 短横线宽度 -->  
          android:dashGap="3dp"   <!-- 两个横线间的宽度 -->  

     <!-- 圆角 -->
     <corners
          android:radius="2dp" />   <!-- 角的弧度,弧度越大,角越圆 -->  
     <!-- 还可以把四个角设定成不同的角度 -->
     <!-- android:topRightRadius="20dp"    右上角 -->
     <!-- android:bottomLeftRadius="20dp"    右下角,注意,这里就是Left,很奇怪的地方 -->
     <!-- android:topLeftRadius="20dp"    左上角 -->
     <!-- android:bottomRightRadius="20dp"    左下角 -->

     <padding
          android:left="10dp"
          android:top="10dp"
          android:right="10dp"
          android:bottom="10dp" />
     </shape>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值