How to scroll to the end of Android TextView?

I have android.widget.EditText (in multi-row mode only) in which I display some information (left half):

enter image description here

From time to time, additional information is added to the end of this android.widget.EditText , and then I would like to scroll to the end of the field (maybe only scroll to the end, if there are already positions at the end, which, in my opinion, are even more user-friendly )

Surprisingly, I could not find information about the cursor and scroll scroll in android.widget.EditText .

I found this post , but I don't have a ScrollView , and I wonder why I want one of them android.widget.EditText to handle its own scolling.

Any ideas or ideas? What did I miss?

+4
source share
3 answers

You know, Casio FX602P was my first programmable computer!

I'm not sure that editView can be made to scroll independently, but if you close the textView with scrollView and turn off the scrollbars, you get what you need.

Another possibility seemed to me; if you use a List instead, which allows you to not only scroll, but also select a line of code that needs to be edited on the display on the right ...

+1
source

If scrolling to the end is all you need, follow these steps:

  this.Printout.setText (""); this.Printout.append (Service.Get_FP10_Printout ()); 

The trick here: android.widget.EditText.append will scroll to the end of the field for you. So I delete the text and then add what I want to display.

If you need another scroll, you need to wrap android.widget.TextView with android.widget.ScollView (as lumis ) and use the trick from Patrick .

+3
source

To accomplish this, you must wrap the EditText in a ScrollView and manage the parent through it. Previously, it was possible to simply use EditText.append to accomplish this, as indicated in one of the append's answers here. However, now Google has made all the standard EditText AppCompat application, which changed the behavior of the add function, it no longer scrolls to the end.

I found out how the functionality of my application has changed after compiling with the new API.

0
source

All Articles