Source set: Common
public class Placeholder(
public val width: TextUnit,
public val height: TextUnit,
public val placeholderVerticalAlign: PlaceholderVerticalAlign,
)
A placeholder is a rectangle box inserted into text, which tells the text processor to leave an empty space. It is typically used to insert inline image, custom emoji, etc into the text paragraph.
Parameters
| width | the width of the placeholder, it must be specified in sp or em. TextUnit.Unspecified is not allowed. |
| height | the height of the placeholder, it must be specified in sp or em. TextUnit.Unspecified is not allowed. |
| placeholderVerticalAlign | the vertical alignment of the placeholder within the text line. Check PlaceholderVerticalAlign for more information. |
Throws: IllegalArgumentException
if TextUnit.Unspecified is passed to width or height.
Functions
copy
Source set: Common
public fun copy(
width: TextUnit = this.width,
height: TextUnit = this.height,
placeholderVerticalAlign: PlaceholderVerticalAlign = this.placeholderVerticalAlign,
): Placeholder