I have a regular EditText field that I would like to programmatically change the underline color for.
<EditText android:id="@+id/edit_password" android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="textPassword"/>
Other answers suggest changing the filter to a background color as follows:
editText.getBackground().setColorFilter(color, PorterDuff.Mode.SRC_IN);
However, I do not see any changes when the application starts. Change the background itself:
editText.setBackground(color)
changes the entire EditText to color - not what I want!
How to programmatically change underline color for EditText , AppCompatEditText or TextInputEditText ? I am using version 25.0.1 in the Support Library.
android
degs
source share