Is there a simple way to size the width of a TextF...
# compose-android
a
Is there a simple way to size the width of a TextField by “ems” (like
android:ems
), or characters … In a form user enters IP port, so it should be wide enough to accomodate 65535. I see one SO post using
TextMeasurer
but wonder if there is something more straightforward.
z
You could layout a non editable text behind the field with alpha 0 but I think you’d need a custom layout to force the field size to match anyway. I’d just use TextMeasurer.
👍 1