android关于shape的gradient属性详解
来源:互联网 发布:忘记数据库密码 编辑:程序博客网 时间:2024/05/17 04:06
安卓刚入门,接触项目过程中用到了drawable中的shape,看文档过程中gradient属性不是很理解。本着站在巨人肩膀上学习的态度,上网找资料。估计打开方式不对,找到资料甚少,只能自己动手,当做笔记,有错请指正,谢谢~
首先文档介绍:
<gradient android:angle="integer" android:centerX="integer" android:centerY="integer" android:centerColor="integer" android:endColor="color" android:gradientRadius="integer" android:startColor="color" android:type=["linear" | "radial" | "sweep"] android:useLevel=["true" | "false"] />
<gradient>shape的颜色渐变属性attributes:android:angleInteger,代表渐变颜色的角度, 0 is left to right, 90 is bottom to top. 必须是45的整数倍. 默认是 0.该属性只有在type=linear情况下起作用,默认的type为linear。默认情况下,从左到右:
xml代码:<gradient android:startColor="#000000" android:endColor="#ffffff" />angle=270,从上到下 : xml代码:<gradient android:startColor="#000000" android:endColor="#ffffff" android:angle="270" />android:startColorColor. 颜色渐变的开始颜色,如angle=270中的 android:startColor="#000000"android:endColorColor. 颜色渐变的结束颜色,如angle=270中的 android:endColor="#ffffff"android:centerColorColor. 颜色渐变的中间颜色,主要用于多彩。
xml代码: <gradient android:startColor="#ff0000" android:endColor="#ffffff" android:centerX="0.2" android:centerX="0.2" android:gradientRadius="30" android:type="radial" /> type="sweep":
xml代码: <gradient android:startColor="#ff0000" android:endColor="#ffffff" android:centerX="0.5" android:centerY="0.5" android:type="sweep" />
阅读全文
1 0
- android关于shape的gradient属性详解
- android关于shape的gradient属性详解
- android关于shape的gradient属性详解
- Shape的gradient属性
- Android (shape,gradient)详解
- android:shape属性详解
- android:shape属性详解
- android:shape属性详解
- Android Shape 属性详解
- android:shape属性详解
- Android shape属性详解
- android:shape属性详解
- android:shape属性详解
- android shape 属性详解
- android:shape属性详解
- android:shape属性详解
- android:shape属性详解
- Android shape属性详解
- BZOJ-1059 二分图匹配
- java开发环境配置(Windows)
- 线程_死锁_解锁
- http://www.cnblogs.com/study-everyday/p/6140580.html
- Java8 Optional(二)
- android关于shape的gradient属性详解
- 自动化测试基础
- PHP 面向对象笔记
- Android ppi 对照 及 api level
- android 7.1悬浮窗系统权限问题
- C++ map注意事项
- Spring 控制反转(IOC)与依赖注入(DI)
- The content of element type "mapper" must match "(cache-ref|cache|resultMap*|parameterMap*|sql*|inse
- Python 爬虫 —— 糗事百科爬虫实战