I am working on dynamic theme apply on Android application concept. I am applying theme color programmatically for all UI. I want to change EditText
selection background color programmatically.
Any help would be much appreciated. I want to change textselection highlight color.
Background color as you mentioned in your question is known as HighlightColor for EditText
.
Try this,
et.setHighlightColor(ContextCompat.getColor(getContext(), R.color.highlight));
To highlight the selection Use setHighlightColor
feature in the code for the EditText
. It is not background color. Its HighLightColor.
IN CODE
editTextName.setHighlightColor(ContextCompat.getColor(getContext(), R.color.highlight));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With