【说明】 | rexseeDrawable使开发者可以预先创建Drawable以便在以后的样式表中使用,在样式表中引用这里创建的Drawable使用格式"drawable://"+id。 |
【函数】 | void add(String id, String string) |
【说明】 | 创建一个Drawable。 |
【返回】 | 无 |
【参数】 | id:Drawable的ID。 string:"http://..."、"file://...."、"drawable://..."或颜色字符串。 |
【示例】 |
rexseeDrawable.add('test','file:///android_asset/touchBallPad.png');
运行示例
rexseeDialog.toast('创建完毕'); rexseeImageDialog.show('test','','background-color:drawable://test;window-cancelable:true;top:30;left:50;width:200px;height:100px;window-modeless:true;window-dim-amount:0;');
使用
|
【函数】 | void remove(String id) |
【说明】 | 销毁一个Drawable。 |
【返回】 | 无 |
【参数】 | id:Drawable的ID。 |
【示例】 |
rexseeDrawable.remove('test');
运行示例
rexseeDialog.toast('删除完毕'); |
【函数】 | void removeAll() |
【说明】 | 销毁所有Drawable。 |
【返回】 | 无 |
【参数】 | 无 |
【示例】 |
rexseeDrawable.removeAll();
运行示例
rexseeDialog.toast('删除完毕'); |
【函数】 | boolean exists(String id) |
【说明】 | 判断Drawable是否存在。 |
【返回】 | true或false。 |
【参数】 | id:Drawable的ID。 |
【示例】 |
alert(rexseeDrawable.exists('test'));
运行示例
|
【函数】 | int size() |
【说明】 | 读取Drawable的个数。 |
【返回】 | Drawable个数。 |
【参数】 | 无 |
【示例】 |
alert(rexseeDrawable.size());
运行示例
|
【函数】 | JsonArray getIds() |
【说明】 | 读取所有Drawable的ID。 |
【返回】 | Json数组,可以使用eval('('+json+')')转换为JavaSript数组。 |
【参数】 | 无 |
【示例】 |
alert(rexseeDrawable.getIds());
运行示例
|
【函数】 | JsonObject getIntrinsicSize(String id) |
【说明】 | 读取Drawable的内置尺寸。 |
【返回】 | Json对象,可以使用eval('('+json+')')转换为JavaSript对象。 |
【参数】 | id:Drawable的ID。 |
【示例】 |
alert(rexseeDrawable.getIntrinsicSize('test'));
运行示例
|
【函数】 | JsonObject getBounds(String id) |
【说明】 | 读取Drawable的边界。 |
【返回】 | Json对象,可以使用eval('('+json+')')转换为JavaSript对象。 |
【参数】 | id:Drawable的ID。 |
【示例】 |
alert(rexseeDrawable.getBounds('test'));
运行示例
|
【函数】 | boolean setBounds(String id, int left, int top, int right, int bottom) |
【说明】 | 设定Drawable的边界。 |
【返回】 | true或false。 |
【参数】 | id:Drawable的ID。 left:左边位置。 top:顶边位置。 right:右边位置。 bottom:底边位置。 |
【示例】 |
rexseeDrawable.setBounds('test',10,100,10,100);
运行示例
rexseeDialog.toast('设置完毕'); |
【函数】 | boolean setAlpha(String id, int alpha) |
【说明】 | 设定Drawable的透明度。 |
【返回】 | true或false。 |
【参数】 | id:Drawable的ID。 alpha:0~255。 |
【示例】 |
rexseeDrawable.setAlpha('test',0);
运行示例
rexseeDialog.toast('设置完毕'); rexseeDrawable.setAlpha('test',255);
运行示例
rexseeDialog.toast('设置完毕'); |
【函数】 | boolean setColorFilter(String id, String color, String mode) |
【说明】 | 设定Drawable的颜色过滤器。 |
【返回】 | true或false。 |
【参数】 |
id:Drawable的ID。
color:形如"#000000"的颜色。 mode:过滤器模式,支持如下模式:
|
【示例】 |
rexseeDrawable.setColorFilter('test','#ff0000','MULTIPLY');
运行示例
rexseeDialog.toast('设置完毕'); rexseeDrawable.setColorFilter('test','#ff0000','LIGHTEN');
运行示例
rexseeDialog.toast('设置完毕'); |
【函数】 | boolean clearColorFilter(String id) |
【说明】 | 清除Drawable的颜色过滤器。 |
【返回】 | true或false。 |
【参数】 | id:Drawable的ID。 |
【示例】 |
rexseeDrawable.clearColorFilter('test');
运行示例
rexseeDialog.toast('设置完毕'); |