How To Change Highlight Color On Edittext Field
Below is a screen shot of a custom edit text field i have in my android app. While you are type a given word, the text for the word you are currently typing highlights in grey and
Solution 1:
I was able to change the highlight of my edit text by adding this line to my themes.xml file:
<item name="android:textColorHighlight">@color/m_highlight_blue</item>
Solution 2:
Simple, just use TextHightLight Property in XML Mode
android:textColorHighlight="#ff0000"
or add this in your theme
<item name="android:textColorHighlight">"#ff0000"</item>
[Image attached here is because for a comment below]
and when i do, this is how it looks
Solution 3:
And if you have to change the Marker handle then you should change
<item name="colorAccent">@color/edittext_handle_selection</item>
<item name="android:textColorHighlight">@color/edittext_selection</item>
Solution 4:
In code:
et.setHighlightColor(ContextCompat.getColor(getContext(), R.color.highlight));
Solution 5:
You should use android:textColorHighlight
in the EditText element in you layout xml file
Post a Comment for "How To Change Highlight Color On Edittext Field"