开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜