3

I need to customize a caret color in the specific text input.

screenshot with needed element

I've found three options to do this but none works for me.

  1. Adding to style.xml the next code:

    <item name="colorControlActivated">@color/white</item>

    But it works for all control items like Switch, other TextInputs etc. And I need to change color only for single TextInput.

  2. I've tried to specify selectionColor, but it works only for cursor and the background of the selected text, not caret.

  3. I've tried to add the drawable xml file and add to style.xml the next thing:

    <item name="android:editTextStyle">@style/myEditText</item>

    <style name="myEditText" parent="@android:style/Widget.Holo.Light.EditText"> <item name="android:textCursorDrawable">@drawable/color_cursor</item> </style> But it is not work at all. Used this answer like template

0 Answers0