https://kotlinlang.org logo
#compose
Title
# compose
o

okaymak

03/30/2023, 12:42 PM
Copy code
@param singleLine when set to true, this text field becomes a single horizontally scrolling text field instead of wrapping onto multiple lines.
How can I disable this scrolling in
BasicTextField
? I want to use
TextLayoutResult#didOverflowWidth
inside
onTextLayout
to decrease the font size, but that doesn’t work; the text always fits because of the scrolling text field.
s

Stylianos Gakis

03/30/2023, 9:39 PM
I'd try and look at the implementation of BasicTextField and figure out where this scrolling behavior comes from. If you do you'll find out if it's configurable or not. If it's not, I guess the solution*might* be to write your own without this bit of code, but definitely sounds like it'd be a hell of a thing to try to do
e

efemoney

03/31/2023, 6:56 AM
You should use maxLines = 1 instead of singleLine
7 Views