Most visited

Recently visited

Added in API level 1

PaintDrawable

public class PaintDrawable
extends ShapeDrawable

java.lang.Object
   ↳ android.graphics.drawable.Drawable
     ↳ android.graphics.drawable.ShapeDrawable
       ↳ android.graphics.drawable.PaintDrawable


可绘制的,绘制在给定的油漆边界,可选圆角。

Summary

Inherited XML attributes

From class android.graphics.drawable.ShapeDrawable

Public constructors

PaintDrawable()
PaintDrawable(int color)

Public methods

void setCornerRadii(float[] radii)

为四个角的每一个指定半径。

void setCornerRadius(float radius)

指定矩形拐角的半径。

Protected methods

boolean inflateTag(String name, Resources r, XmlPullParser parser, AttributeSet attrs)

子类重写此分析自定义子元素。

Inherited methods

From class android.graphics.drawable.ShapeDrawable
From class android.graphics.drawable.Drawable
From class java.lang.Object

Public constructors

PaintDrawable

Added in API level 1
PaintDrawable ()

PaintDrawable

Added in API level 1
PaintDrawable (int color)

Parameters
color int

Public methods

setCornerRadii

Added in API level 1
void setCornerRadii (float[] radii)

为四个角的每一个指定半径。 对于每个角落,数组包含2个值,[X_radius,Y_radius]。 角落的顺序是左上角,右上角,右下角,左下角

Parameters
radii float: the x and y radii of the corners

setCornerRadius

Added in API level 1
void setCornerRadius (float radius)

指定矩形拐角的半径。 如果这是> 0,那么drawable绘制在一个圆形的矩形中,而不是一个矩形。

Parameters
radius float: the radius for the corners of the rectangle

Protected methods

inflateTag

Added in API level 1
boolean inflateTag (String name, 
                Resources r, 
                XmlPullParser parser, 
                AttributeSet attrs)

子类重写此分析自定义子元素。 如果你处理它,返回true,否则返回super.inflateTag(...)

Parameters
name String
r Resources
parser XmlPullParser
attrs AttributeSet
Returns
boolean

Hooray!