Is there any way to set position of cursor in EditText from left to right 2dp
android, android-edittext, position, text-cursor
Solution
You can set `paddingLeft` attribute in XML
<EditText
android:layout_width="90dp"
android:layout_height="70dp"
android:text="BBBBB"
android:hint="AAAAAAAAAAAAAAAAAAAA"
android:paddingLeft="30dp"/>
Or set from code
EditText edt = (EditText)findViewById(R.id.edt);
edt.setPadding(2, 0, 0, 0); //int left, int top, int right, int bottom
Checked on real device
Problem
is there any way to set position of cursor in EditText from left to right depend on px. I use this code ``` EditText etEmail = (EditText) findViewById(R.id.et_email); etEmail.setText("Email"); etEmail.setSelection(2); ``` it work but the Email text not remove. so I change `etEmail.setText("Email")` to `etEmail.setHnt("Email")` like this ``` EditText etEmail = (EditText) findViewById(R.id.et_email); etEmail.setHint("Email"); etEmail.setSelection(2); ``` but it Error. Is there any way to set position of cursor in EditText? this is the first load this is want I want ``` <EditText android:id="@+id/et_email" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/fillbox" android:hint="Email" android:ems="10" android:inputType="textEmailAddress" /> ```