Textview always position displayed text at the end

Asked

Viewed 673 times

0

How to do in the TextView so that when inserting text it becomes as a single line and the text box is accompanied as you write?

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Hello World!" />

When you insert text into TextView, when it arrives at the end of the text box it will insert and you do not see, I want to make you see what is being typed, the initial part will hide and not adjust.

  • 2
  • @Diegofelipe this is another question, because when you insert text in TextView, when it arrives at the end of the text box it goes inserting and you do not see, I want to make you see what being typed the other part goes hiding and not adjust on the screen referring to another question

  • Please edit the question to add details...

1 answer

2


Trade in Edittext

As you insert the text you implement the code below together

//posiciona o cursor no final do EditText
etReplicar.setSelection(etReplicar.getText().length());

In your xml your Edit text should look like this to behave like a Textview

     <EditText
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:inputType="textPersonName"
            android:focusable="false"
            android:id="@+id/et_replicar" />
  • it worked out it was I wanted, only one question has how to go back just to visualize the typed.

  • swipe the touch n of the?

  • you asked a question, with your finger on the touch did not give, but there would be another way? , I tried the horizontalScrollView but without success.

  • Which version of android you’re testing, I did the test here and managed to move the content to read? (I tested in version 4.1.1)

  • I tested in version 4.1.2 physical device and emulator 4.4, but what did you do ? , just touched with your finger.

  • I tried it again it worked but it keeps crashing, and it didn’t pick up at first and I had to make a random move by pulling horizontal then vertical to see content.There’s a way to improve this. ?

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.