public abstract class Drawable
Drawable主要是一个抽象类,供其子类实现,重写一些方法,我们最常用的有BitmapDrawable,还有其它比如:
BitmapDrawable
ClipDrawable
ColorDrawable
DrawableContainer
GradientDrawable
InsetDrawable
LayerDrawable--TransitionDrawable
NinePatchDrawable
PictureDrawable
RotateDrawable
ScaleDrawable
ShapeDrawable
好像只用过一个哦,好悲剧。。。
还有一些比较重要的方法,就是这个Drawable是从哪里创建的,从方法名称中,我们可以看到它是从哪创建的:
public static Drawable createFromStream(InputStream is, String srcName)
public static Drawable createFromResourceStream(Resources res, TypedValue value, InputStream is, String srcName)
public static Drawable createFromResourceStream(Resources res, TypedValue value,
InputStream is, String srcName, BitmapFactory.Options opts)
public static Drawable createFromXml(Resources r, XmlPullParser parser)
public static Drawable createFromXmlInner(Resources r, XmlPullParser parser, AttributeSet attrs)
public static Drawable createFromPath(String pathName)