How to change the brightness of the EditText cursor?

1

I would like to know the name of the attribute that changes that color bar, Thanks.

    
asked by anonymous 02.07.2016 / 22:45

1 answer

4

The EditText has an attribute that defines the drawable to use for the cursor.

Create drawable :

my_cursor.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
    <size android:width="1dp" />
    <solid android:color="#FF0000"  />
</shape>

size android:width defines the thickness. solid android:color defines the color.

Assign this drawable to the android:textCursorDrawable attribute:

<EditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:textCursorDrawable="@drawable/my_cursor"/>
    
03.07.2016 / 00:08