ShapeDrawable.ShaderFactory
public static abstract class ShapeDrawable.ShaderFactory
extends Object
基类定义了一个工厂对象,每当drawable被调整大小(有一个新的宽度或高度)时被调用。 它的resize()方法返回一个相应的着色器,或者返回null。 实现这个类,如果你想你的ShapeDrawable使用特殊Shader
,如LinearGradient
。
摘要(Summary)
公共方法(Public methods) |
abstract Shader |
resize(int width, int height) 返回绘制Drawable时要绘制的着色器。 |
Public constructors
ShapeDrawable.ShaderFactory
ShapeDrawable.ShaderFactory ()
公共方法(Public methods)
resize
Shader resize (int width,
int height)
返回绘制Drawable时要绘制的着色器。 Drawable的尺寸被传递,因为它们可能需要调整Shader的绘制配置。 这由ShapeDrawable.setShape()调用。
参数(Parameters) |
width |
int : the width of the Drawable being drawn |
height |
int : the heigh of the Drawable being drawn |
返回(Returns) |
Shader |
the Shader to be drawn |