Android版的EditText的setText和输入文本在上? [英] Android EditText setText and input text in last?
问题描述
我用的EditText输入一些信息,我的EditText的setText。结果
但我有一个问题,当EditText上显示器,键盘显示了。
当我输入的文本将在第一,我之前设置的文本后,不添加文字!
I use EditText to input some information, and I setText in EditText.
But I have a problem, when EditText display, the keyboard display too.
when I input text it will add text in first not after text that I set before!
这是我的EDITTEXT键盘
this is my editText with keyboard
[这里是键盘输入文字]例如< - 这个例子是我的setText
[here is keyboard input text]example <- this example is my setText
我需要我的文字像这样经过设置输入文本
I need to set up input text after my text like this
为例[这里是键盘输入文字]
example[here is keyboard input text]
感谢您的帮助......
Thanks for help ....
推荐答案
我想你需要setSelection移动到文本的结尾
I think you need setSelection to move to end of your text
EditText et = (EditText)findViewById(R.id.edittext1);
et.setSelection(et.getText().length());
这篇关于Android版的EditText的setText和输入文本在上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!