I'm trying to deal with the degenerate "longer tha...
# compose
t
I'm trying to deal with the degenerate "longer than expected label/name" field case. I can specify maxLines = 1 and overflow = TextOverflow.Ellipses to some effect. But I was hoping that TextOverflow had options for tightening letter spacing and/or shrinking font to a point before elipsing. iOS has fields for this right in the designer. Is there a technique one can go about to achieve a similiar result? Builtin solutions would be preferrable (to me)
e
nothing built-in at the moment and I generally think auto-sizing is a poor solution to the problem too
t
what do you think is a better solution then?
i did admit it was the "degenerate case..."
z
You could build something using TextMeasurer
e
in my team's case, we've simply forced all our designers to take long texts into account
t
Given that I allow users to input a name for a given shared asset, and many devices will view that name, from little to big, I'm not sure how I would enforce that or ask designers to cope gracefully with it. What happens, when for grins, someone names one of their irrigation plans by copying in the preamble to the declaration of independence? For grins.
e
<marquee>
(just kidding)
in our case we have reasonable name length limitations but still use maxLines=3 when displaying many simple fields such as name
t
it's nice to see (looking at that roadmap) that Autosize Text is an "in focus" thing. Not sure what that really means though