Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set EditText cursor color

I am having this issue where I am using the Android's Holo theme on a tablet project. However, I have a fragment on screen which has a white background. I am adding an EditText component on this fragment. I've tried to override the theme by setting the background of the Holo.Light theme resources. However, my text cursor (carat) remains white and hence, invisible on screen (I can spot it faintly in the edittext field..).

Does anyone know how I can get EditText to use a darker cursor color? I've tried setting the style of the EditText to "@android:style/Widget.Holo.Light.EditText" with no positive result.

like image 558
dineth Avatar asked Aug 30 '11 03:08

dineth


People also ask

How do I change the cursor color in edit text?

Setting the android:textCursorDrawable attribute to @null should result in the use of android:textColor as the cursor color. Save this answer.


1 Answers

Setting the android:textCursorDrawable attribute to @null should result in the use of android:textColor as the cursor color.

Attribute "textCursorDrawable" is available in API level 12 and higher

like image 135
Dean Avatar answered Sep 28 '22 02:09

Dean