Placeholder
@Immutable data class Placeholder
kotlin.Any | |
↳ | androidx.compose.ui.text.Placeholder |
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.
Summary
Public constructors | |
---|---|
<init>(width: TextUnit, height: TextUnit, placeholderVerticalAlign: PlaceholderVerticalAlign) A placeholder is a rectangle box inserted into text, which tells the text processor to leave an empty space. |
Properties | |
---|---|
TextUnit |
the height of the placeholder, it must be specified in sp or em. |
PlaceholderVerticalAlign |
the vertical alignment of the placeholder within the text line. |
TextUnit |
the width of the placeholder, it must be specified in sp or em. |
Public constructors
<init>
Placeholder(
width: TextUnit,
height: TextUnit,
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: TextUnit | the width of the placeholder, it must be specified in sp or em. TextUnit.Unspecified is not allowed. |
height: TextUnit | the height of the placeholder, it must be specified in sp or em. TextUnit.Unspecified is not allowed. |
placeholderVerticalAlign: PlaceholderVerticalAlign | the vertical alignment of the placeholder within the text line. Check PlaceholderVerticalAlign for more information. |
Exceptions | |
---|---|
IllegalArgumentException |
if TextUnit.Unspecified is passed to width or height. |
Properties
height
val height: TextUnit
the height of the placeholder, it must be specified in sp or em. TextUnit.Unspecified is not allowed.
placeholderVerticalAlign
val placeholderVerticalAlign: PlaceholderVerticalAlign
the vertical alignment of the placeholder within the text line. Check PlaceholderVerticalAlign for more information.
width
val width: TextUnit
the width of the placeholder, it must be specified in sp or em. TextUnit.Unspecified is not allowed.