再写一个edittext输入时候发现光标一直在左边,不是跟随输入后面,几番折腾,谷歌后终于找到方法
EditText inputField = new EditText(this);
Editable etext = inputField.getText();
int position = etext.length();
Selection.setSelection(etext, position);
Editable etext = inputField.getText();
int position = etext.length();
Selection.setSelection(etext, position);