how to set Edit Textbox cursor start to some default position?
im using a edittext box drawable where the border is little graphical like it has two line border.the thing is if i enter the text its overlapping with t开发者_高级运维he edge of the box.how can i create a space/ gap in the beginning,so that i can enter the text after 1/2 spaces gap from the left end.
Thanks
EditText editText = (EditText) findViewById(R.id.textId);
editText.setText("EditText component");
editText.setSelection(3);
try this code to set cursor to position 3.
If you just want to add space at strting try adding paddingLeft attribute in your code.
Thanks.
精彩评论