Set EditText cursor color
Setting the android:textCursorDrawable
attribute to @null
should result in the use of android:textColor
as the cursor color.
Attribute "textCursorDrawable" is available in API level 12 and higher
In Layout
<EditText android:layout_width="fill_parent" android:layout_height="wrap_content" android:textCursorDrawable="@drawable/color_cursor" />
Then create drawalble xml: color_cursor
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" > <size android:width="3dp" /> <solid android:color="#FFFFFF" /></shape>
You have a white color cursor on EditText property.
It appears as if all the answers go around the bushes.
In your EditText
, use the property:
android:textCursorDrawable="@drawable/black_cursor"
and add the drawable black_cursor.xml
to your resources, as follows:
<?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="#000000"/></shape>
This is also the way to create more diverse cursors, if you need.