首页 > 移动平台 > 详细

Android Drawable

时间:2015-11-10 16:04:05      阅读:512      评论:0      收藏:0      [点我收藏+]

1. Shape

属性: 

(1) solid ( 填充 )

      参数:android:color ( 填充的颜色 )

(2) gradient ( 渐变 )

      参数:android:startColor ( 开始颜色 ) 、android:endColor ( 结束颜色 )、android:angle ( 渐变角度 )、android:type ( linear\radial  线性渐变\径向渐变 )

      其渐变模式默认为:android:type="linear",径向渐变需要指定半径android:gradientRadius="50"。

(3) stroke ( 描边 )

      参数:android:width ( 描边的宽度 )、android:color ( 描边的颜色 )、android:dashWidth ( 虚线横线的宽度 )、android:dashGap ( 虚线横线之前的距离 )

(4) corners ( 圆角 )

      参数:android:topRightRadius ( 右上角 )、android:bottomLeftRadius ( 右下角 )、android:topLeftRadius ( 左上角 )、android:bottomRightRadius ( 左下角 )

      android:bottomLeftRadius是右下角,而不是左下角。

(5) padding ( 间隔 )

      参数:android:paddingTop ( 上间隔 )、android:paddingBottom ( 下间隔 )、android:paddingLeft ( 左间隔 )、android:paddingRight ( 右间隔 )

 

shape画线(水平线):

 1 <?xml version="1.0" encoding="utf-8"?>
 2 <shape
 3    xmlns:android="http://schemas.android.com/apk/res/android"
 4    android:shape="line">
 5 
 6    <!-- 描边 -->
 7    <stroke
 8         android:width="2dip"
 9         android:color="#FFFFFFF" />
10 
11    <size android:height="20dip"/>
12 </shape>

 

Android Drawable

原文:http://www.cnblogs.com/CharlesGrant/p/4953155.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!