# DynamicDrawableSpan

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Constants](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan#constants)\|[Fields](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan#lfields)\|[Ctors](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan#pubctors)\|[Protected Ctors](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan#proctors)\|[Methods](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan#inhmethods)  

# DynamicDrawableSpan

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/text/style/DynamicDrawableSpan "View this page in Kotlin")\|Java

`
public


abstract
class
DynamicDrawableSpan
`  
`


``


``


``

extends `[ReplacementSpan](https://developer.android.com/reference/android/text/style/ReplacementSpan)`


``


`

|---|---|---|---|----------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) |||||
| ↳ | [android.text.style.CharacterStyle](https://developer.android.com/reference/android/text/style/CharacterStyle) ||||
|   | ↳ | [android.text.style.MetricAffectingSpan](https://developer.android.com/reference/android/text/style/MetricAffectingSpan) |||
|   |   | ↳ | [android.text.style.ReplacementSpan](https://developer.android.com/reference/android/text/style/ReplacementSpan) ||
|   |   |   | ↳ | android.text.style.DynamicDrawableSpan |

|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Known direct subclasses [ImageSpan](https://developer.android.com/reference/android/text/style/ImageSpan) |-----------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [ImageSpan](https://developer.android.com/reference/android/text/style/ImageSpan) | Span that replaces the text it's attached to with a[Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable)that can be aligned with the bottom or with the baseline of the surrounding text. | |

<br />

*** ** * ** ***

Span that replaces the text it's attached to with a[Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable)that can be aligned with the bottom or with the baseline of the surrounding text.

For an implementation that constructs the drawable from various sources (`Bitmap`,`Drawable`, resource id or`Uri`) use[ImageSpan](https://developer.android.com/reference/android/text/style/ImageSpan).

A simple implementation of`DynamicDrawableSpan`that uses drawables from resources looks like this:  

```
 class MyDynamicDrawableSpan extends DynamicDrawableSpan {

 private final Context mContext;
 private final int mResourceId;

 public MyDynamicDrawableSpan(Context context, @DrawableRes int resourceId) {
     mContext = context;
     mResourceId = resourceId;
 }

 @Override
 public Drawable getDrawable() {
      Drawable drawable = mContext.getDrawable(mResourceId);
      drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
      return drawable;
 }
 }
```
The class can be used like this:  

```
 SpannableString string = new SpannableString("Text with a drawable span");
 string.setSpan(new MyDynamicDrawableSpan(context, R.mipmap.ic_launcher), 12, 20, Spanned
 .SPAN_EXCLUSIVE_EXCLUSIVE);
```
![](https://developer.android.com/static/reference/android/images/text/style/dynamicdrawablespan.png)Replacing text with a drawable.

<br />

## Summary

|                                                                                                                                         ### Constants                                                                                                                                         ||
|-------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [ALIGN_BASELINE](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan#ALIGN_BASELINE) A constant indicating that the bottom of this span should be aligned with the baseline of the surrounding text.                                                        |
| `int` | [ALIGN_BOTTOM](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan#ALIGN_BOTTOM) A constant indicating that the bottom of this span should be aligned with the bottom of the surrounding text, i.e., at the same level as the lowest descender in the text. |
| `int` | [ALIGN_CENTER](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan#ALIGN_CENTER) A constant indicating that this span should be vertically centered between the top and the lowest descender.                                                               |

|                                                                       ### Fields                                                                       ||
|------------------------|--------------------------------------------------------------------------------------------------------------------------------|
| ` protected final int` | [mVerticalAlignment](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan#mVerticalAlignment) <br /> |

|                                                                                                                ### Public constructors                                                                                                                 ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[DynamicDrawableSpan](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan#DynamicDrawableSpan())`() ` Creates a[DynamicDrawableSpan](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan). |

|                                                                                                                                          ### Protected constructors                                                                                                                                           ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[DynamicDrawableSpan](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan#DynamicDrawableSpan(int))`(int verticalAlignment) ` Creates a[DynamicDrawableSpan](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan)based on a vertical alignment.\\ |

|                                                                                                                                                                                                                                                                                                                                 ### Public methods                                                                                                                                                                                                                                                                                                                                  ||
|----------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` void`                                                                                            | ` `[draw](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan#draw(android.graphics.Canvas,%20java.lang.CharSequence,%20int,%20int,%20float,%20int,%20int,%20int,%20android.graphics.Paint))`(`[Canvas](https://developer.android.com/reference/android/graphics/Canvas)` canvas, `[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)` text, int start, int end, float x, int top, int y, int bottom, `[Paint](https://developer.android.com/reference/android/graphics/Paint)` paint) ` Draws the span into the canvas. |
| ` abstract `[Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable) | ` `[getDrawable](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan#getDrawable())`() ` Your subclass must implement this method to provide the bitmap to be drawn.                                                                                                                                                                                                                                                                                                                                                                                 |
| ` int`                                                                                             | ` `[getSize](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan#getSize(android.graphics.Paint,%20java.lang.CharSequence,%20int,%20int,%20android.graphics.Paint.FontMetricsInt))`(`[Paint](https://developer.android.com/reference/android/graphics/Paint)` paint, `[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)` text, int start, int end, `[Paint.FontMetricsInt](https://developer.android.com/reference/android/graphics/Paint.FontMetricsInt)` fm) ` Returns the width of the span.                         |
| ` int`                                                                                             | ` `[getVerticalAlignment](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan#getVerticalAlignment())`() ` Returns the vertical alignment of this span, one of[ALIGN_BOTTOM](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan#ALIGN_BOTTOM),[ALIGN_BASELINE](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan#ALIGN_BASELINE)or[ALIGN_CENTER](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan#ALIGN_CENTER).                                              |
| ` `[String](https://developer.android.com/reference/java/lang/String)                              | ` `[toString](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan#toString())`() ` Returns a string representation of the object.                                                                                                                                                                                                                                                                                                                                                                                                                    |

| ### Inherited methods |
|-----------------------|---|
| From class` `[android.text.style.ReplacementSpan](https://developer.android.com/reference/android/text/style/ReplacementSpan)` ` |-----------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract void`                                                                  | ` `[draw](https://developer.android.com/reference/android/text/style/ReplacementSpan#draw(android.graphics.Canvas,%20java.lang.CharSequence,%20int,%20int,%20float,%20int,%20int,%20int,%20android.graphics.Paint))`(`[Canvas](https://developer.android.com/reference/android/graphics/Canvas)` canvas, `[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)` text, int start, int end, float x, int top, int y, int bottom, `[Paint](https://developer.android.com/reference/android/graphics/Paint)` paint) ` Draws the span into the canvas. | | ` `[CharSequence](https://developer.android.com/reference/java/lang/CharSequence) | ` `[getContentDescription](https://developer.android.com/reference/android/text/style/ReplacementSpan#getContentDescription())`() ` Gets a brief description of this ReplacementSpan for use in accessibility support.                                                                                                                                                                                                                                                                                                                                                      | | ` abstract int`                                                                   | ` `[getSize](https://developer.android.com/reference/android/text/style/ReplacementSpan#getSize(android.graphics.Paint,%20java.lang.CharSequence,%20int,%20int,%20android.graphics.Paint.FontMetricsInt))`(`[Paint](https://developer.android.com/reference/android/graphics/Paint)` paint, `[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)` text, int start, int end, `[Paint.FontMetricsInt](https://developer.android.com/reference/android/graphics/Paint.FontMetricsInt)` fm) ` Returns the width of the span.                         | | ` void`                                                                           | ` `[setContentDescription](https://developer.android.com/reference/android/text/style/ReplacementSpan#setContentDescription(java.lang.CharSequence))`(`[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)` contentDescription) ` Sets the specific content description into ReplacementSpan.                                                                                                                                                                                                                                                    | | ` void`                                                                           | ` `[updateDrawState](https://developer.android.com/reference/android/text/style/ReplacementSpan#updateDrawState(android.text.TextPaint))`(`[TextPaint](https://developer.android.com/reference/android/text/TextPaint)` ds) ` This method does nothing, since ReplacementSpans are drawn explicitly instead of affecting Paint properties.                                                                                                                                                                                                                                  | | ` void`                                                                           | ` `[updateMeasureState](https://developer.android.com/reference/android/text/style/ReplacementSpan#updateMeasureState(android.text.TextPaint))`(`[TextPaint](https://developer.android.com/reference/android/text/TextPaint)` p) ` This method does nothing, since ReplacementSpans are measured explicitly instead of affecting Paint properties.                                                                                                                                                                                                                          | ||
| From class` `[android.text.style.MetricAffectingSpan](https://developer.android.com/reference/android/text/style/MetricAffectingSpan)` ` |----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[MetricAffectingSpan](https://developer.android.com/reference/android/text/style/MetricAffectingSpan) | ` `[getUnderlying](https://developer.android.com/reference/android/text/style/MetricAffectingSpan#getUnderlying())`() ` Returns "this" for most MetricAffectingSpans, but for MetricAffectingSpans that were generated by[CharacterStyle.wrap(CharacterStyle)](https://developer.android.com/reference/android/text/style/CharacterStyle#wrap(android.text.style.CharacterStyle)), returns the underlying MetricAffectingSpan. | | ` abstract void`                                                                                         | ` `[updateMeasureState](https://developer.android.com/reference/android/text/style/MetricAffectingSpan#updateMeasureState(android.text.TextPaint))`(`[TextPaint](https://developer.android.com/reference/android/text/TextPaint)` textPaint) ` Classes that extend MetricAffectingSpan implement this method to update the text formatting in a way that can change the width or height of characters.                         | ||
| From class` `[android.text.style.CharacterStyle](https://developer.android.com/reference/android/text/style/CharacterStyle)` ` |-------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[CharacterStyle](https://developer.android.com/reference/android/text/style/CharacterStyle)        | ` `[getUnderlying](https://developer.android.com/reference/android/text/style/CharacterStyle#getUnderlying())`() ` Returns "this" for most CharacterStyles, but for CharacterStyles that were generated by[wrap(CharacterStyle)](https://developer.android.com/reference/android/text/style/CharacterStyle#wrap(android.text.style.CharacterStyle)), returns the underlying CharacterStyle. | | ` abstract void`                                                                                      | ` `[updateDrawState](https://developer.android.com/reference/android/text/style/CharacterStyle#updateDrawState(android.text.TextPaint))`(`[TextPaint](https://developer.android.com/reference/android/text/TextPaint)` tp) `                                                                                                                                                                | | ` static `[CharacterStyle](https://developer.android.com/reference/android/text/style/CharacterStyle) | ` `[wrap](https://developer.android.com/reference/android/text/style/CharacterStyle#wrap(android.text.style.CharacterStyle))`(`[CharacterStyle](https://developer.android.com/reference/android/text/style/CharacterStyle)` cs) ` A given CharacterStyle can only applied to a single region of a given Spanned.                                                                            | ||
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Constants

### ALIGN_BASELINE

Added in[API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int ALIGN_BASELINE
```

A constant indicating that the bottom of this span should be aligned with the baseline of the surrounding text.

<br />

Constant Value: 1 (0x00000001)  

### ALIGN_BOTTOM

Added in[API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int ALIGN_BOTTOM
```

A constant indicating that the bottom of this span should be aligned with the bottom of the surrounding text, i.e., at the same level as the lowest descender in the text.

<br />

Constant Value: 0 (0x00000000)  

### ALIGN_CENTER

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int ALIGN_CENTER
```

A constant indicating that this span should be vertically centered between the top and the lowest descender.

<br />

Constant Value: 2 (0x00000002)

## Fields

### mVerticalAlignment

Added in[API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
protected final int mVerticalAlignment
```

<br />

<br />

## Public constructors

### DynamicDrawableSpan

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public DynamicDrawableSpan ()
```

Creates a[DynamicDrawableSpan](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan). The default vertical alignment is[ALIGN_BOTTOM](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan#ALIGN_BOTTOM)

<br />

## Protected constructors

### DynamicDrawableSpan

Added in[API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
protected DynamicDrawableSpan (int verticalAlignment)
```

Creates a[DynamicDrawableSpan](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan)based on a vertical alignment.\\

<br />

|                                                                                                                                                                                                                                                                                                                                                             Parameters                                                                                                                                                                                                                                                                                                                                                              ||
|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `verticalAlignment` | `int`: one of[ALIGN_BOTTOM](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan#ALIGN_BOTTOM),[ALIGN_BASELINE](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan#ALIGN_BASELINE)or[ALIGN_CENTER](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan#ALIGN_CENTER)Value is[ALIGN_BOTTOM](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan#ALIGN_BOTTOM),[ALIGN_BASELINE](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan#ALIGN_BASELINE), or[ALIGN_CENTER](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan#ALIGN_CENTER) <br /> |

## Public methods

### draw

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void draw (Canvas canvas, 
                CharSequence text, 
                int start, 
                int end, 
                float x, 
                int top, 
                int y, 
                int bottom, 
                Paint paint)
```

Draws the span into the canvas.

<br />

|                                    Parameters                                    ||
|----------|------------------------------------------------------------------------|
| `canvas` | `Canvas`: This value cannot be`null`. <br />                           |
| `text`   | `CharSequence`: Current text. <br />                                   |
| `start`  | `int`: Value is 0 or greater <br />                                    |
| `end`    | `int`: Value is 0 or greater <br />                                    |
| `x`      | `float`: Edge of the replacement closest to the leading margin. <br /> |
| `top`    | `int`: Top of the line. <br />                                         |
| `y`      | `int`: Baseline. <br />                                                |
| `bottom` | `int`: Bottom of the line. <br />                                      |
| `paint`  | `Paint`: This value cannot be`null`. <br />                            |

### getDrawable

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public abstract Drawable getDrawable ()
```

Your subclass must implement this method to provide the bitmap to be drawn. The dimensions of the bitmap must be the same from each call to the next.

<br />

|                                            Returns                                             ||
|----------------------------------------------------------------------------------------|--------|
| [Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable) | <br /> |

### getSize

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public int getSize (Paint paint, 
                CharSequence text, 
                int start, 
                int end, 
                Paint.FontMetricsInt fm)
```

Returns the width of the span. Extending classes can set the height of the span by updating attributes of[Paint.FontMetricsInt](https://developer.android.com/reference/android/graphics/Paint.FontMetricsInt). If the span covers the whole text, and the height is not set,[draw(android.graphics.Canvas, java.lang.CharSequence, int, int, float, int, int, int, android.graphics.Paint)](https://developer.android.com/reference/android/text/style/ReplacementSpan#draw(android.graphics.Canvas,%20java.lang.CharSequence,%20int,%20int,%20float,%20int,%20int,%20int,%20android.graphics.Paint))will not be called for the span.

<br />

|                            Parameters                            ||
|---------|---------------------------------------------------------|
| `paint` | `Paint`: This value cannot be`null`. <br />             |
| `text`  | `CharSequence`: Current text. <br />                    |
| `start` | `int`: Value is 0 or greater <br />                     |
| `end`   | `int`: Value is 0 or greater <br />                     |
| `fm`    | `Paint.FontMetricsInt`: This value may be`null`. <br /> |

|             Returns              ||
|-------|---------------------------|
| `int` | Width of the span. <br /> |

### getVerticalAlignment

Added in[API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public int getVerticalAlignment ()
```

Returns the vertical alignment of this span, one of[ALIGN_BOTTOM](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan#ALIGN_BOTTOM),[ALIGN_BASELINE](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan#ALIGN_BASELINE)or[ALIGN_CENTER](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan#ALIGN_CENTER).

<br />

|                                                                                                                                                                             Returns                                                                                                                                                                              ||
|-------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | Value is[ALIGN_BOTTOM](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan#ALIGN_BOTTOM),[ALIGN_BASELINE](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan#ALIGN_BASELINE), or[ALIGN_CENTER](https://developer.android.com/reference/android/text/style/DynamicDrawableSpan#ALIGN_CENTER) <br /> |

### toString

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public String toString ()
```

Returns a string representation of the object.

<br />

|                                                      Returns                                                      ||
|--------------------------------------------------------------------|-----------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | a string representation of the object. <br /> |