标签:
android EditText获取光标位置并插入字符删除字符
1.获取光标位置
int index = editText.getSelectionStart();
2.在光标处插入字符
int index = editText.getSelectionStart();
Editable editable = editText.getText();
editable.insert(index, "aaaa");
3.删除光标前字符
int index = editText.getSelectionStart();
Editable editable = editText.getText();
editable.delete(index-1, index);
android EditText获取光标位置并安插字符删除字符
标签:
原文地址:http://www.cnblogs.com/qiaoxu/p/4586898.html