Created
November 8, 2022 09:14
-
-
Save cp-radhika-s/24d593fb0ca49761e683d7ebf7f91660 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@OptIn(ExperimentalTextApi::class) | |
@Composable | |
fun ExampleTextOverFlow() { | |
val textMeasure = rememberTextMeasurer() | |
Canvas( | |
onDraw = { | |
drawRect(color = Color.Black) | |
drawText( | |
textMeasurer = textMeasure, | |
text = //...some long string, | |
overflow = TextOverflow.Ellipsis, | |
maxLines = 3 | |
) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment