[ACCEPTED]-Disable Word Wrap in an Android Multi-Line TextView-nowrap
In Java:
setHorizontallyScrolling(boolean)
In theory, android:scrollHorizontally 2 should do the same in XML, but there is 1 a bug in android that stops it working.
android:singleLine
-----this is for xml
setTransformationMethod(TransformationMethod)
-----this is for java
Constrains 7 the text to a single horizontally scrolling 6 line instead of letting it wrap onto multiple 5 lines, and advances focus instead of inserting 4 a newline when you press the enter key.
I'm 3 not sure if this will work, but it worked 2 for me when I wanted my TextView not to 1 wrap in my ListView
Currently the best answer for XML is
android:maxLines="1"
Because 1 android:singleLine is now depreciated
More Related questions
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.