Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/text/style/LineBackgroundSpan#nestedclasses) \| [Methods](https://developer.android.com/reference/android/text/style/LineBackgroundSpan#pubmethods)

# LineBackgroundSpan

*** ** * ** ***


`
public


interface
LineBackgroundSpan
`


`


implements

https://developer.android.com/reference/android/text/style/ParagraphStyle


`

|---|
| android.text.style.LineBackgroundSpan |

|---|
| Known indirect subclasses [LineBackgroundSpan.Standard](https://developer.android.com/reference/android/text/style/LineBackgroundSpan.Standard) |---|---| | [LineBackgroundSpan.Standard](https://developer.android.com/reference/android/text/style/LineBackgroundSpan.Standard) | Default implementation of the `https://developer.android.com/reference/android/text/style/LineBackgroundSpan`, which changes the background color of the lines to which the span is attached. | |

<br />

*** ** * ** ***

Used to change the background of lines where the span is attached to.

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/android/text/style/LineBackgroundSpan.Standard` Default implementation of the `https://developer.android.com/reference/android/text/style/LineBackgroundSpan`, which changes the background color of the lines to which the span is attached. |

| ### Public methods ||
|---|---|
| ` abstract void` | ` https://developer.android.com/reference/android/text/style/LineBackgroundSpan#drawBackground(android.graphics.Canvas,%20android.graphics.Paint,%20int,%20int,%20int,%20int,%20int,%20java.lang.CharSequence,%20int,%20int,%20int)(https://developer.android.com/reference/android/graphics/Canvas canvas, https://developer.android.com/reference/android/graphics/Paint paint, int left, int right, int top, int baseline, int bottom, https://developer.android.com/reference/java/lang/CharSequence text, int start, int end, int lineNumber) ` Draw the background on the canvas. |

## Public methods

### drawBackground

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

```
public abstract void drawBackground (Canvas canvas, 
                Paint paint, 
                int left, 
                int right, 
                int top, 
                int baseline, 
                int bottom, 
                CharSequence text, 
                int start, 
                int end, 
                int lineNumber)
```

Draw the background on the canvas.

<br />

| Parameters ||
|---|---|
| `canvas` | `Canvas`: canvas on which the span should be rendered. This value cannot be `null`. <br /> |
| `paint` | `Paint`: paint used to draw text, which should be left unchanged on exit. This value cannot be `null`. <br /> |
| `left` | `int`: left position of the line relative to input canvas, in pixels. The units of this value are pixels. <br /> |
| `right` | `int`: right position of the line relative to input canvas, in pixels. The units of this value are pixels. <br /> |
| `top` | `int`: top position of the line relative to input canvas, in pixels. The units of this value are pixels. <br /> |
| `baseline` | `int`: baseline of the text relative to input canvas, in pixels. The units of this value are pixels. <br /> |
| `bottom` | `int`: bottom position of the line relative to input canvas, in pixels. The units of this value are pixels. <br /> |
| `text` | `CharSequence`: current text. This value cannot be `null`. <br /> |
| `start` | `int`: start character index of the line <br /> |
| `end` | `int`: end character index of the line <br /> |
| `lineNumber` | `int`: line number in the current text layout <br /> |