The classes that affect the line height of paragraph should implement this interface.
Nested classes |
class |
LineHeightSpan.Standard
Default implementation of the LineHeightSpan , which changes the line height of the
attached paragraph.
|
interface |
LineHeightSpan.WithDensity
The classes that affect the line height of paragraph with respect to density,
should implement this interface.
|
Public methods
chooseHeight
public abstract void chooseHeight (CharSequence text,
int start,
int end,
int spanstartv,
int lineHeight,
Paint.FontMetricsInt fm)
Classes that implement this should define how the height is being calculated.
Parameters |
text |
CharSequence : the text |
start |
int : the start of the line |
end |
int : the end of the line |
spanstartv |
int : the start of the span |
lineHeight |
int : the line height |
fm |
Paint.FontMetricsInt : font metrics of the paint, in integers |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# LineHeightSpan\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Nested Classes](#nestedclasses) \\| [Methods](#pubmethods) \n\nLineHeightSpan\n==============\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/text/style/LineHeightSpan \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\n\n\ninterface\nLineHeightSpan\n`\n\n\n`\n\n\nimplements\n\n`[ParagraphStyle](/reference/android/text/style/ParagraphStyle)`,\n\n`[WrapTogetherSpan](/reference/android/text/style/WrapTogetherSpan)`\n\n\n`\n\n|-----------------------------------|\n| android.text.style.LineHeightSpan |\n\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known indirect subclasses [DrawableMarginSpan](/reference/android/text/style/DrawableMarginSpan), [IconMarginSpan](/reference/android/text/style/IconMarginSpan), [LineHeightSpan.Standard](/reference/android/text/style/LineHeightSpan.Standard), [LineHeightSpan.WithDensity](/reference/android/text/style/LineHeightSpan.WithDensity) |----------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------| | [DrawableMarginSpan](/reference/android/text/style/DrawableMarginSpan) | A span which adds a drawable and a padding to the paragraph it's attached to. | | [IconMarginSpan](/reference/android/text/style/IconMarginSpan) | Paragraph affecting span, that draws a bitmap at the beginning of a text. | | [LineHeightSpan.Standard](/reference/android/text/style/LineHeightSpan.Standard) | Default implementation of the [LineHeightSpan](/reference/android/text/style/LineHeightSpan), which changes the line height of the attached paragraph. | | [LineHeightSpan.WithDensity](/reference/android/text/style/LineHeightSpan.WithDensity) | The classes that affect the line height of paragraph with respect to density, should implement this interface. | |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nThe classes that affect the line height of paragraph should implement this interface.\n\nSummary\n-------\n\n| ### Nested classes ||\n|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` class` | [LineHeightSpan.Standard](/reference/android/text/style/LineHeightSpan.Standard) Default implementation of the [LineHeightSpan](/reference/android/text/style/LineHeightSpan), which changes the line height of the attached paragraph. |\n| ` interface` | [LineHeightSpan.WithDensity](/reference/android/text/style/LineHeightSpan.WithDensity) The classes that affect the line height of paragraph with respect to density, should implement this interface. |\n\n| ### Public methods ||\n|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[chooseHeight](/reference/android/text/style/LineHeightSpan#chooseHeight(java.lang.CharSequence,%20int,%20int,%20int,%20int,%20android.graphics.Paint.FontMetricsInt))`(`[CharSequence](/reference/java/lang/CharSequence)` text, int start, int end, int spanstartv, int lineHeight, `[Paint.FontMetricsInt](/reference/android/graphics/Paint.FontMetricsInt)` fm) ` Classes that implement this should define how the height is being calculated. |\n\nPublic methods\n--------------\n\n### chooseHeight\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void chooseHeight (CharSequence text, \n int start, \n int end, \n int spanstartv, \n int lineHeight, \n Paint.FontMetricsInt fm)\n```\n\nClasses that implement this should define how the height is being calculated.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|--------------|-----------------------------------------------------------------------|\n| `text` | `CharSequence`: the text \u003cbr /\u003e |\n| `start` | `int`: the start of the line \u003cbr /\u003e |\n| `end` | `int`: the end of the line \u003cbr /\u003e |\n| `spanstartv` | `int`: the start of the span \u003cbr /\u003e |\n| `lineHeight` | `int`: the line height \u003cbr /\u003e |\n| `fm` | `Paint.FontMetricsInt`: font metrics of the paint, in integers \u003cbr /\u003e |"]]