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.
There is a new way to change cursor color in latest
Appcompact
v21Just change
colorAccent
in style like this:Then apply this style on your app theme or activities.
Update: this way only works on API 21+Update 2: I'm not sure the minimum android version that it can work.
Tested by android version:
For me I modified both the AppTheme and a value colors.xml
Here is the colors.xml
I took out the android:textCursorDrawable attribute to @null that I placed inside the editText style. When I tried using this, the colors would not change.
Its even easier than that.
This works in ICS and beyond. I haven't tested it in other versions.
use this
android:textCursorDrawable="@color/white"