How to set the Text's width in the same way we use to do with
android:ems
?
d
Dominaezzz
06/24/2021, 9:59 PM
fontSize = 5.em
?
a
aoriani
06/24/2021, 10:10 PM
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
Zach Klippenstein (he/him) [MOD]
06/25/2021, 12:13 AM
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