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画线(水平线):

 <?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line"> <!-- 描边 -->
<stroke
android:width="2dip"
android:color="#FFFFFFF" /> <size android:height="20dip"/>
</shape>

Android Drawable的更多相关文章

  1. Android Drawable的9种子类 介绍

    原文: Android Drawable的9种子类 介绍   Drawable 在android里面 就是代表着图像,注意是图像 而不是图片. 图片是图像的子集.图像除了可以包含图片以外 还可以包含颜 ...

  2. 【转】Android Drawable Resource学习(十一)、RotateDrawable

    对另一个drawable资源,基于当前的level,进行旋转的drawable. 文件位置: res/drawable/filename.xml文件名即资源名 编译数据类型: 指向 RotateDra ...

  3. Android Drawable 与 LayerList综合汇总

    先看需求.要求这样的效果 上代码 <?xml version="1.0" encoding="utf-8"? > <layer-list xm ...

  4. Android Drawable绘图学习笔记(转)

    如何获取 res 中的资源 数据包package:android.content.res 主要类:Resources Android SDK中的简介:Class for accessing an ap ...

  5. 【转】【Android】Android Drawable Shape 组合画田字格

    使用layer-list组合多个Shap <?xml version="1.0" encoding="utf-8"?> <layer-list ...

  6. Android Drawable Mipmap Vector使用及Vector兼容

    原文地址:http://blog.csdn.net/eclipsexys/article/details/51838119 http://blog.csdn.net/qq_15545283/artic ...

  7. Android Studio插件:Android Drawable Importer

    Android Drawable Importer 为了在不同分辨率的设备上更好的展示图片的效果,我们往往需要在 res/drawable 中添加不同分辨率的图片.有时我们可能手里只有一份分辨率的图片 ...

  8. Android Drawable 详解(教你画画!)

    参考 1.Android中的Drawable基础与自定义Drawable 2.android中的drawable资源 3.Android开发之Shape详细解读 Drawable分类 No xml标签 ...

  9. Android drawable 加载效果

    <animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:ones ...

  10. Android Drawable 那些不为人知的高效用法

    转载请标明出处:http://blog.csdn.net/lmj623565791/article/details/43752383,本文出自:[张鸿洋的博客] 1.概述 Drawable在我们平时的 ...

随机推荐

  1. Android ANR分析(1)

    转自:http://blog.csdn.net/itachi85/article/details/6918761 一:什么是ANR ANR:Application Not Responding,即应用 ...

  2. mysql基础一

    一.概述 1.什么是数据库 ? 答:数据的仓库,如:在ATM的示例中我们创建了一个 db 目录,称其为数据库 2.什么是 MySQL.Oracle.SQLite.Access.MS SQL Serve ...

  3. penghui_031413 Bat命令学习

    penghui_031413   Bat命令学习 基础部分:====================================================================== ...

  4. 对服务器的ftp端口进行修改

    对服务器的ftp端口进行了修改,把21端口改了,比如221端口,就这样用221连接的时候,连接登录成功,但打不开目录,为何,总结如下: 1.完成一个FTP的传输过程不仅仅只需要21一个端口,而是2个端 ...

  5. hdu 1404 找sg ***

    HDU 1404  Digital Deletions 一串由0~9组成的数字,可以进行两个操作:1.把其中一个数变为比它小的数:2.把其中一个数字0及其右边的所以数字删除. 两人轮流进行操作,最后把 ...

  6. C# 指针操作图像 二值化处理

    /// <summary> /// 二值化图像 /// </summary> /// <param name="bmp"></param& ...

  7. 利用canvas实现抽奖转盘---转载别人的

    功能需求 转盘要美观,转动效果流畅. 转盘上需要显示奖品图片,并且奖品是后台读取的照片和名字. 转动动画完成后要有相应提示. 获取的奖品具体算法在数据库里操作,前端只提供最后的效果展示.   知识要点 ...

  8. 启动Tomcat服务器报错: Several ports (8005, 8080, 8009) required

    错误记录--更改tomcat端口号方法,Several ports (8005, 8080, 8009) http://blog.csdn.net/xinxin19881112/article/det ...

  9. BootCDN和npm

    稳定.快速.免费的开源项目 CDN 服务 BootCDN: jQuery3 <script type="text/javascript" src="http://c ...

  10. form表单验证和事件

    1.表单验证<form></form> (1).非空验证(去空格) (2).对比验证(跟一个值对比) (3).范围验证(根据一个范围进行判断) (4).固定格式验证:电话号码, ...