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. 从数据库导出数为生成excel表

    mysql -umaster -hxx.xx.xx.xx -p -e "set names utf8; use xxxdb;select * from t_order where t_ord ...

  2. HTTP1.0和HTTP1.1的主要区别是

    HTTP/.0协议使用非持久连接,即在非持久连接下,一个tcp连接只传输一个Web对象 HTTP/.1默认使用持久连接(然而,HTTP/.1协议的客户机和服务器可以配置成使用非持久连接)在持久连接下, ...

  3. Android ANR分析(三)

    http://www.jianshu.com/p/8964812972be http://stackoverflow.com/questions/704311/android-how-do-i-inv ...

  4. python多线程之Condition(条件变量)

    #!/usr/bin/env python # -*- coding: utf-8 -*- from threading import Thread, Condition import time it ...

  5. hdu 3695:Computer Virus on Planet Pandora(AC自动机,入门题)

    Computer Virus on Planet Pandora Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 256000/1280 ...

  6. 时间编程,王明学learn

    时间编程 一.时间类型 Coordinated Universal Time(UTC):世界标准时间,也就是大家所熟知的格林威治标准时间(Greenwich Mean Time,GMT) Calend ...

  7. C/C++面试题

    第一部分:基本概念及其它问答题 1.   关键字static的作用是什么? 这个简单的问题很少有人能回答完全.在C语言中,关键字static有三个明显的作用: 1). 在函数体,一个被声明为静态的变量 ...

  8. [荐]javascript Date format(js日期格式化)

    cnblog:http://www.cnblogs.com/zhangpengshou/archive/2012/07/19/2599053.html 方法一: // 对Date的扩展,将 Date  ...

  9. Serializable序列化对象

    Serializable序列化对象发送: Intent intent = new Intent(); intent.setClass(mContext, HomeDetailReportActivit ...

  10. wpf template的code写法

    this.Template = XamlReader.Load ("<ControlTemplate xmlns='http://schemas.microsoft.com/clien ...