开发者

Android edittext - settextmethod cursor issue

I am trying to settext in an开发者_StackOverflow中文版 EditText...But after setText is done, the cursor remains at the start of text.how can i move it to the end of the text?

Any help in this regard is appreciated.

Best Regards, Rony


EditText inputField;
Editable etext = inputField.getText();
int position = etext.length();
inputField.setSelection(position);


Use append(CharSequence text). This will also update the position of the cursor. See Android Documentation


Try append("Hello"); instead of setText()

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜