Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EditText cursor not visible in Android 3.0

Tags:

android

I am working on Android 3.0. I am using an EditText that has a transparent background . The EditText is placed on a layout having a white background. As a result the EditText cursor is not visible (I assume the cursor is white by default) . After going through your forum I found out a solution that says I have to create my own cursor drawable using styles.xml.

But to my dismay, the cursorDrawable parameter is available only in Android 3.1. But I have to work on 3.0 and above.

Is there any solution?

like image 935
kirtipriya Avatar asked Mar 08 '26 23:03

kirtipriya


1 Answers

Add these attributes to your EditText, to make the blinking cursor black:

android:textColor="#000000"
android:textCursorDrawable="@null"

It's needed if you're using the Holo theme. And it will work on older Android versions if you set the minSDK value in the AndroidManifest.xml

From: https://stackoverflow.com/a/9165217/1267112

like image 118
Jimmy Avatar answered Mar 10 '26 15:03

Jimmy