为什么80%的码农都做不了架构师?>>>   

用处:需要一个绘制一个矩形、椭圆、线形、圆形的时候

文件位置:

res/drawable/filename.xml

语法

<?xml version="1.0" encoding="utf-8"?>
<shape<!-- 矩形,椭圆,直线,环形-->xmlns:android="http://schemas.android.com/apk/res/android"android:shape=["rectangle" | "oval" | "line" | "ring"] ><!--圆角 --><corners<!-- 设置四个角的半径-->android:radius="integer"android:topLeftRadius="integer" 单独设置左上角半径android:topRightRadius="integer" 单独设置右上角半径android:bottomLeftRadius="integer" 单独设置左下角半径android:bottomRightRadius="integer" 单独设置右下角半径/><!-- 渐变 --><gradientandroid:angle="integer" 渐变角度,必须是45的倍数,0也是45倍数android:centerX="integer" 相对X轴的渐变位置android:centerY="integer" 相对Y轴的渐变位置android:centerColor="integer" 渐变的中间颜色android:endColor="color" 渐变的结尾颜色<!--  半径梯度或是渐变颜色的半径,仅仅当type=linear的时候有用 --><!--  如果android:type="radial",没有设置android:gradientRadius将会报错,error inflating class -->android:gradientRadius="integer"android:startColor="color" 渐变的开始颜色android:type=["linear" | "radial" | "sweep"] 渐变类型,线性渐变|径向渐变|扫描或是梯度渐变android:useLevel=["true" | "false"] /> 当做是LevelListDrawable使用时值为true,否则为false<!-- 间隔 --><!--  设置四个方向上的间隔 --><paddingandroid:left="integer"android:top="integer"android:right="integer"android:bottom="integer" /><sizeandroid:width="integer" 形状的宽度,as a dimension value or dimension resource.android:height="integer" 形状的高度 as a dimension value or dimension resource./><!-- 填充 --><solidandroid:color="color" The color to apply to the shape, as a hexadecimal value or color resource./><!-- 描边 --><!-- dashWidth和dashGap属性,只要其中一个设置为0dp,则边框为实现边框 --><strokeandroid:width="integer" 设置边边的宽度 android:color="color" 设置边边的颜色 android:dashWidth="integer" 设置虚线的宽度 android:dashGap="integer"  设置虚线的间隔宽度/>
</shape>

转载于:https://my.oschina.net/qenter/blog/621623

Shape Drawable相关推荐

  1. Shape Drawable Xml的background

    2019独角兽企业重金招聘Python工程师标准>>> <?xml version="1.0" encoding="utf-8"?> ...

  2. Android Shape Drawable Resources

    本文主要介绍Drawable Resources的一种,Shape Drawable Resources的使用.其他Drawable类似 经常需要自己设置某个view的背景,比如类似新浪微博客户端微博 ...

  3. (转载)Android GradientDrawable(shape标签定义) 静态使用和动态使用(圆角,渐变实现)

    最近被吐槽界面太丑,还是很尴尬的,全公司就一个UI设计师,所以很多事情还是不忍直视,一个同事问我,背景可不可以使用渐变的感觉,然后我就有种突然感觉眼前一亮的感觉.还真的没有做过这方面的东西,单纯使用渐 ...

  4. android shape的可选参数以及每个参数的含义与用法!

    2019独角兽企业重金招聘Python工程师标准>>> <span style="font-size:18px"><?xml version=& ...

  5. Android 中shape的使用(圆角矩形)

    一.在res/drawable文件夹下创建一个xml文件: <?xml version="1.0" encoding="utf-8"?> <! ...

  6. Android中如何查看在res中存放的drawable文件对应的JAVA类型是什么呢

    有些时候需要将res中的资源文件加载进来然后做一些修改,然后再赋值给控件使用,比如这样: Drawable drawable = getResources().getDrawable(int id); ...

  7. XML Drawable

    android把任何可绘制在屏幕上的图形图像都称为drawable. XML drawable与像素密度无关,将其放入drawable目录即可. 一.shape drawable <shape ...

  8. Android 中shape的使用(圆角矩形)

    一.在res/drawable文件夹下创建一个名为gradient_box的xml文件: 1 <?xml version="1.0" encoding="utf-8 ...

  9. android shape 底部线,android用shape给linearLayout设置边框,怎样只保留底部或顶部的边框,把其它三个方向的边框去掉呢?...

    http://bbs.csdn.net/topics/390485215 这种方法只是两个颜色块相减而已 android:top="1dp" android:left=" ...

最新文章

  1. ABAP程序相互调用--SUBMIT
  2. 可逆加密算法 php,php可逆加密的方法及原理
  3. Windows Server入门系列之十六 端口、连接与端口扫描
  4. 在哪里定义_创意设计学院举办设计从哪里来,到哪里去”专题讲座
  5. pyqt生成 android,PyQt on Android
  6. webpack钩子调用shell笔记
  7. Skywalking-09:OAL原理——如何通过动态生成的Class类保存数据
  8. find_first_of()和 find_last_of()
  9. c语言任意位数逆序数,C语言求助!一个三位数的逆序数,总是编不对
  10. thinkjdbc 关闭_ThinkJD: ThinkJD,又名ThinkJDBC,一个强大的开源JDBC/ORM操作库,让你尽可能简洁地用一行代码搞定数据库操作。...
  11. saetv2.ex.class.php,curl out of memory window下PHP调用curl报内存不够
  12. cmd 环境下载文件的几种方法
  13. vue开发App商城实战项目
  14. 逆向破解必备基础smail基础语法
  15. 公司职员薪水管理系统(List)
  16. 二分钟倒计时c语言编程,c语言分钟倒计时代码.docx
  17. Z05 - 004、网站流量多维度细分(流量分析)
  18. c语言程序设计21点扑克牌,C语言程序设计 21点扑克牌游戏.doc
  19. 【06月21日】北上资金持股比例排名
  20. 实现调用阿里云API第一章——API请求与认证

热门文章

  1. XEN的clone和copy那点事
  2. iphone 常用预编译代码
  3. System.Data.OracleClient 需要 Oracle 客户端软件 8.1.7 或更高版本?
  4. python制作贪吃蛇游戏_用Python写贪吃蛇游戏的代码实例
  5. 【Linux 内核 内存管理】Linux 内核堆内存管理 ② ( 动态分配堆内存方式 | brk 系统调用 | mmap 系统调用 | brk 系统调用源码介绍 )
  6. 【计算理论】图灵机 ( 非确定性图灵机 | 非确定性图灵机指令分析 | 计算过程 | 非确定性指令出现多个分支 | 非确定性图灵机转为计算树 | 计算树 )
  7. 【数据挖掘】卷积神经网络 ( 视觉原理 | CNN 模仿视觉 | 卷积神经网络简介 | 卷积神经网络组成 | 整体工作流程 | 卷积计算图示 | 卷积计算简介 | 卷积计算示例 | 卷积计算参数 )
  8. 【C++ 语言】面向对象 ( 类定义 | 限制头文件引用次数 | 构造方法 | 析构方法 )
  9. 【网络安全】网络安全攻防 -- 黑客攻击简要流程
  10. 【Android 应用开发】BluetoothClass详解