TextView position text displayed always at the end

0

How to do in TextView so that when entering text it stays as a line only and the text box goes with it as you go?

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

When you enter text in TextView , when it arrives at the end of the text box it inserts and you do not see, I want to make you see what is being typed, the beginning part is hiding and does not adjust .

    
asked by anonymous 16.01.2016 / 00:46

1 answer

2

Switch to EditText

As you enter the text you implement the code below

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

In your xml your edit text should look like this as a TextView

     <EditText
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:inputType="textPersonName"
            android:focusable="false"
            android:id="@+id/et_replicar" />
    
16.01.2016 / 14:57