Android Drawable Resource学习(十三)、其他的Drawable资源
来源:互联网 发布:淘宝刷流量有用么 编辑:程序博客网 时间:2024/04/30 02:41
从Drawable的继承结构上看,还有几个没有介绍到。
1、ColorDrawable
ColorDrawable使用很简单,使用<Color>元素就可以定义一个ColorDrawable,然后再其他的地方使用。
在color.xml文件中定义:
- <?xml version="1.0" encoding="utf-8"?>
- <color xmlns:android="http://schemas.android.com/apk/res/android"
- android:color="#00FF00">
- </color>
- <TextView
- android:layout_width="100px"
- android:layout_height="wrap_content"
- android:text="测试"
- android:background="@drawable/color">
- </TextView>
2、ShapeDrawable和PaintDrawable
都是用来绘制Shape的。不能通过xml文件创建,将在以后的Graphics中学习。
3、AnimationDrawable
用来创建动画的,因为有的动画并不是Drawable,所以将他归为anim Resource。将在以后学习动画的学习。
4、DrawableContainer
一个帮助类,包含了多个Drawable,你可以选中一个拿来使用。你也可以继承它重写自己的DrawableContainers。或者直接使用它的某个子类。
AnimationDrawable, LevelListDrawable, StateListDrawable都是它的子类。
5、PictureDrawable
将在后面的Graphics中学习到。
5、PictureDrawable
将在后面的Graphics中学习到。
0 0
- Android Drawable Resource学习(十三)、其他的Drawable资源
- Android Drawable Resource学习(十三)、其他的Drawable资源
- Android Drawable Resource学习(十三)、其他的Drawable资源
- Android Drawable Resource学习(十三)、ShapeDrawable
- Android Drawable Resource学习(一)、Drawable Resource简介
- Android Drawable Resource学习(一)、Drawable Resource简介
- Android Drawable Resource学习(一)、Drawable Resource简介
- Android Drawable Resource学习(一)、Drawable Resource简介
- Android Drawable Resource学习(一)、Drawable Resource简介
- Android Drawable Resource学习(一)、Drawable Resource简介
- Android Drawable Resource学习(一)、Drawable Resource简介
- Android Drawable Resource学习(四)、LayerDrawable
- Android Drawable Resource学习(五)、StateListDrawable
- Android Drawable Resource学习(六)、LevelListDrawable
- Android Drawable Resource学习(七)、TransitionDrawable
- Android Drawable Resource学习(八)、InsetDrawable
- Android Drawable Resource学习(九)、ClipDrawable
- Android Drawable Resource学习(十)、ScaleDrawable
- poj 1276 多重背包+二进制解法
- JDBC:JDBC资源释放的细节问题
- MATLAB中feval函数的用法
- LeetCode题解——Add Binary
- 0134 Web应用中的轻量级消息队列
- Android Drawable Resource学习(十三)、其他的Drawable资源
- iOS开发UI篇—Quartz2D使用(图形上下文栈)
- 使用Visual Leak Detector帮助检测使用VS时的内存泄漏
- 使用 Nginx 的 X-Sendfile 机制控制文件访问权限(php版)
- android 联系人源码分析 新字段的添加流程
- c提高(2)
- webpack 使用插件
- iOS开发UI篇—Quartz2D使用(矩阵操作)
- Android系统