How to remove the standard highlight around the active EditText? and when I press the button, I would like it not to stand out in my standard blue color. What properties need to change for this?
1 answer
This is done using custom styles (ColorState). You must first determine your style, like:
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_window_focused="false" android:state_enabled="true" android:drawable="@drawable/textfield_default" /> <item android:state_window_focused="false" android:state_enabled="false" android:drawable="@drawable/textfield_disabled_red" /> <item android:state_pressed="true" android:drawable="@drawable/textfield_pressed_red" /> <item android:state_enabled="true" android:state_focused="true" android:drawable="@drawable/textfield_selected_red" /> <item android:state_enabled="true" android:drawable="@drawable/textfield_default" /> <item android:state_focused="true" android:drawable="@drawable/textfield_disabled_selected_red" /> <item android:drawable="@drawable/textfield_disabled_red" /> </selector>
Further in EditText we make a link to it:
<EditText android:background="@drawable/my_edittext_style_states"/>
In principle, you can change the same programmatically. Read here
|