修改EditText光标位置

EditText有这么个便利方法

/**
 * Convenience for {@link Selection#setSelection(Spannable, int)}.
 */
public void setSelection(int index) {
    Selection.setSelection(getText(), index);
}

实际上调用的是这个 ```java /** * Move the cursor to offset index. */ public static final void setSelection(Spannable text, int index) { setSelection(text, index, index); } ```
原文地址:https://www.cnblogs.com/zhudongfang/p/4329518.html