Most visited

Recently visited

Added in API level 1

ImageSpan

public class ImageSpan
extends DynamicDrawableSpan

java.lang.Object
   ↳ android.text.style.CharacterStyle
     ↳ android.text.style.MetricAffectingSpan
       ↳ android.text.style.ReplacementSpan
         ↳ android.text.style.DynamicDrawableSpan
           ↳ android.text.style.ImageSpan


Summary

Inherited constants

From class android.text.style.DynamicDrawableSpan

Inherited fields

From class android.text.style.DynamicDrawableSpan

Public constructors

ImageSpan(Bitmap b)

此构造函数在API级别4中已弃用。请改为使用ImageSpan(Context, Bitmap)

ImageSpan(Bitmap b, int verticalAlignment)

此构造函数在API级别4中已弃用。请改用{@link #ImageSpan(Context,Bitmap,int)。

ImageSpan(Context context, Bitmap b)
ImageSpan(Context context, Bitmap b, int verticalAlignment)
ImageSpan(Drawable d)
ImageSpan(Drawable d, int verticalAlignment)
ImageSpan(Drawable d, String source)
ImageSpan(Drawable d, String source, int verticalAlignment)
ImageSpan(Context context, Uri uri)
ImageSpan(Context context, Uri uri, int verticalAlignment)
ImageSpan(Context context, int resourceId)
ImageSpan(Context context, int resourceId, int verticalAlignment)

Public methods

Drawable getDrawable()

你的子类必须实现这个方法来提供要绘制的位图。

String getSource()

返回构造过程中保存的源字符串。

Inherited methods

From class android.text.style.DynamicDrawableSpan
From class android.text.style.ReplacementSpan
From class android.text.style.MetricAffectingSpan
From class android.text.style.CharacterStyle
From class java.lang.Object

Public constructors

ImageSpan

Added in API level 1
ImageSpan (Bitmap b)

此构造函数在API级别4中已被弃用。
改为使用ImageSpan(Context, Bitmap)

Parameters
b Bitmap

ImageSpan

Added in API level 3
ImageSpan (Bitmap b, 
                int verticalAlignment)

此构造函数在API级别4中已被弃用。
改用{@link #ImageSpan(Context,Bitmap,int)。

Parameters
b Bitmap
verticalAlignment int

ImageSpan

Added in API level 4
ImageSpan (Context context, 
                Bitmap b)

Parameters
context Context
b Bitmap

ImageSpan

Added in API level 4
ImageSpan (Context context, 
                Bitmap b, 
                int verticalAlignment)

Parameters
context Context
b Bitmap
verticalAlignment int: one of ALIGN_BOTTOM or ALIGN_BASELINE.

ImageSpan

Added in API level 1
ImageSpan (Drawable d)

Parameters
d Drawable

ImageSpan

Added in API level 3
ImageSpan (Drawable d, 
                int verticalAlignment)

Parameters
d Drawable
verticalAlignment int: one of ALIGN_BOTTOM or ALIGN_BASELINE.

ImageSpan

Added in API level 1
ImageSpan (Drawable d, 
                String source)

Parameters
d Drawable
source String

ImageSpan

Added in API level 3
ImageSpan (Drawable d, 
                String source, 
                int verticalAlignment)

Parameters
d Drawable
source String
verticalAlignment int: one of ALIGN_BOTTOM or ALIGN_BASELINE.

ImageSpan

Added in API level 1
ImageSpan (Context context, 
                Uri uri)

Parameters
context Context
uri Uri

ImageSpan

Added in API level 3
ImageSpan (Context context, 
                Uri uri, 
                int verticalAlignment)

Parameters
context Context
uri Uri
verticalAlignment int: one of ALIGN_BOTTOM or ALIGN_BASELINE.

ImageSpan

Added in API level 1
ImageSpan (Context context, 
                int resourceId)

Parameters
context Context
resourceId int

ImageSpan

Added in API level 3
ImageSpan (Context context, 
                int resourceId, 
                int verticalAlignment)

Parameters
context Context
resourceId int
verticalAlignment int: one of ALIGN_BOTTOM or ALIGN_BASELINE.

Public methods

getDrawable

Added in API level 1
Drawable getDrawable ()

你的子类必须实现这个方法来提供要绘制的位图。 每次调用时,位图的尺寸必须相同。

Returns
Drawable

getSource

Added in API level 1
String getSource ()

返回构造过程中保存的源字符串。

Returns
String

Hooray!