3

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?

Tamás
  • 47,239
  • 12
  • 105
  • 124
kirtipriya
  • 148
  • 3
  • 8

3 Answers3

8

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

Community
  • 1
  • 1
Jimmy
  • 221
  • 3
  • 6
0

It's working fine But , Cursor not blinking in my 3.1 device

Raj008
  • 3,539
  • 2
  • 28
  • 26
0

Setting minimum width (5dp) to edit text while using wrap_text as layout_width will show the cursor when the edittext's background is transparent.

Neanderthal
  • 937
  • 2
  • 9
  • 25