bug in Android EditText cursor in 4.0 bug and solutions

  • 2020-12-19 21:12:43
  • OfStack

This paper analyzes bug in Android with EditText cursor in 4.0 and its solution. To share for your reference, the details are as follows:

1. The question is:

I don't know why, when my EditText appeared in my own mobile phone, its cursor became missing. At first, I thought the cursor was missing. Later, I changed the background color of EditText for 1 time, and found that the cursor was white, so I didn't see it.

2. Solutions:

android:textCursorDrawable

Set the value to "@null", but I don't think that looks very nice, and that place could be replaced with your own icon.

One more thing to note, you must change your Android project build target to one version 4.0.3 or above. In the next run, you'll find your cursor in front of you.

I hope this article has been helpful in Android programming.


Related articles: