How to set the Text's width in the same way we use...
# compose
a
How to set the Text's width in the same way we use to do with
android:ems
?
d
fontSize = 5.em
?
a
Thanks @Dominaezzz. I didn't know
em
was a unit in Compose. Are you suggesting me to try something like
Copy code
Text("Hello", modifier = Modifier.width(5.em))
?
z
That won’t work, and think Compose does not support it because the string can have multiple fonts and sizes internally, so outside of the string measurement itself
em
doesn’t have much meaning.