1.在资源文件drawable下新建一个光标控制color_cursor.xml
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<size android:width="1dp" />
<solid android:color="#008000" />
</shape>
2.设置EditText:android:textCursorDrawable="@drawable/color_cursor"