I'd like to measure the width of a hypothetical composable, and then use that to set other widths. Is there a good way to do that? My layout looks like:
Row { Text(t1) Canvas Text(t2) }
. I want to measure a hypothetical
Text(longestPossibleString)
and use that to set width of the two Texts, so that things are centered and don't move as t1 and t2 change.
Mm. The docs for that say it calculates "width and height", but then it's only properties are
mix/maxIntrinsicWidth
. Where's the height?
z
Zach Klippenstein (he/him) [MOD]
04/26/2021, 4:08 AM
Ah you said Row, so didn’t think you needed height. Take a look at the other classes in that package, might be something that gives you height
👍 1
r
robnik
04/26/2021, 1:09 PM
Ah, right. I forgot and returned to this thread later with a different code situation. But you are correct, that package helps with both width and height. Eg,