Search code examples
androidandroid-studiotextviewcursor

How can I move the text in a text view like 10dp to the right?


I want to move the text like 10dp to the right, not the TextView but the written text + the cursor.

How can I do that?

Thanks.

The "Hallo" is too near the border


Solution

  • give android:paddingStart =10dp or android:paddingLeft =10dp to this Textview in your layout

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingStart="10dp"
        android:text="Hello!"/>
    

    For detail explaination about the difference refer this link