How can I have a single line Text render in all th...
# compose
m
How can I have a single line Text render in all the available width until it's cut off? Given I have text "Some long text is cutoff" I want this:
|Some long text is cu|
I am getting this:
|Some long text is   |
The last word is not rendered at all. I thought
TextOverflow.Visible
would be the behavior I want, but it doesn't change it.
e
is something like
Copy code
Modifier
    .clipToBounds()
    .wrapContentWidth(align = Alignment.Start, unbounded = true)
the way you want it to clip?
d
Try
softWrap = false,
m
Thanks, both
wrapContentWidth
and
softWrap = false
works, and both need
clipToBounds()
as well.
e
(I was curious if you wanted the behavior of truncating in the middle of a character)
d
I had used
.fillMaxWidth(0.5f)
in my test instead of
clipToBounds()
. More than one way to do it i guess.
m
> (I was curious if you wanted the behavior of truncating in the middle of a character) Yes, the container is user-resizeable and the text shouldn't "change" as you resize with characters popping into existence.