I've set a TextView as the display. I want to display the operation being performed in one line, for example:
9856243187 + 2457896123 - 214583
The problem is, when the input reaches the edge of the TextView - it jumps to the next line.
So, is there anyway to avoid this behavior and keep the input in one line, even if it goes out of the screen?
If you just want to add a line break in the form: textView. setText(string1+System. getProperty ("line. separator")+string2); then it works a treat, thank you!
Set The Text of The TextView You can set the text to be displayed in the TextView either when declaring it in your layout file, or by using its setText() method. The text is set via the android:text attribute. You can either set the text as attribute value directly, or reference a text defined in the strings.
Textview : should be used for uneditable text which user wants to read but not to manipulate. e.g. News, Articles, Blogs. Plain text/ Edittext : should be used for taking user input in alphanumeric form. e.g. UserId, Comments.
You should use android:maxLines="1"
in your TextView tag. android:singleLine="true"
is deprecated.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With