Drawable简单使用
来源:互联网 发布:java电商项目经验 编辑:程序博客网 时间:2024/04/30 12:56
Android文档这样定义Drawable的:
A Drawable is a general abstraction for "something that can be drawn." Most often you will deal with Drawable as the type of resource retrieved for drawing things to the screen; the Drawable class provides a generic API for dealing with an underlying visual resource that may take a variety of forms. Unlike a View
, a Drawable does not have any facility to receive events or otherwise interact with the user.
Drawable就是一个可画的对象,其可能是一张位图(BitmapDrawable),也可能是一个图形(ShapeDrawable),还有可能是一个图层(LayerDrawable),我们根据画图的需求,创建相应的可画对象,就可以将这个可画对象当作一块“画布(Canvas)”,在其上面操作可画对象,并最终将这种可画对象显示在画布上,有点类似于“内存画布“。
下面的一个自定义View显示了ShapeDrawable的一些简单使用方式:
程序运行效果如下图:
- Drawable简单使用
- Drawable使用
- Drawable first 思想使用drawable
- Drawable资源资源使用
- 使用(Drawable)资源
- 使用drawable资源
- 继续使用drawable资源
- Drawable Resource 使用笔记
- Drawable Animation 使用介绍
- Drawable Resources使用
- drawable的使用
- Android中的Drawable使用
- Vector Drawable 使用
- Drawable基本使用
- Drawable shape 的使用
- Drawable 的使用
- Android:Vector Drawable 使用
- Android Drawable 对象使用
- 广播的发送和接收
- 2步成为一位伟大的开发者
- HDOJ 1013
- MKMapView学习笔记
- OneNote 发送至 CSDN
- Drawable简单使用
- WINDOWS 逻辑坐标 设备坐标 屏幕坐标 客户区坐标
- Socket编程基础范例
- RegQueryValueEx函数返回234错误解决方法
- 重写Ext.MessageBox.confirm中文按钮名称
- 彻底搞定C指针---指向指针的指针
- DAY 5
- CSS常用技巧介绍
- 七种武器:Collection 之 Google Guava