I\'m trying to build a renderer for Xamarin Forms. The renderer needs to set the EditText
underline color to \"Active Color\" when selected and \"Hint Color\" when
To change color you can use below code
editText.getBackground().mutate().setColorFilter(your_color), PorterDuff.Mode.SRC_ATOP);
And to set different color underline for EditText view on focus change
editText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (hasFocus) {
editText.getBackground().mutate().setColorFilter(getResources().getColor(android.R.color.holo_purple), PorterDuff.Mode.SRC_ATOP);
}else {
editText.getBackground().mutate().setColorFilter(getResources().getColor(android.R.color.holo_red_dark), PorterDuff.Mode.SRC_ATOP);
}
}
});