Home > Back-end >  How can I write in EditText at any position?
How can I write in EditText at any position?

Time:07-15

If I click in center into EditText my cursor will be move to start position but I want edit my Edit Text in any position wherever I click, for example - center. How can I do it?

My code:

<EditText
        android:id="@ id/description_input"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:ems="10"
        android:gravity="top"
        android:inputType="textMultiLine"
        android:minHeight="48dp"
        android:text="Name" />

CodePudding user response:

In any position ? It is not possible. Maybe if you "fill" your EditText with space character...

If you want to enter character from the middle, use android:gravity="top|center"

CodePudding user response:

If your edittext is filled with content, you may click any character and the cursor will move to where you click.

  • Related