码迷,mamicode.com
首页 > 移动开发 > 详细

Android Drawable

时间:2015-11-10 16:05:33      阅读:207      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!