I want to change the android's edittext cursor color on all devices. How do I do that?
i had to use a drawable like this:
mycursor.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="@android:color/holo_blue_light"/>
<!--make sure its a solid tag not stroke or it wont work -->
</shape>
in my edit text i set the cursor drawable attributes like this:
<EditText
android:id="@+id/et_details"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:cursorVisible="true"
android:textCursorDrawable="@drawable/mycursor"
/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With