lika85456 lika85456 - 2 months ago 12
Android Question

How do I change the EditText divider color?

I have an

EditText
in my app, if i click it, the divider color changes to pink, how can i change this color?
This is how it currently is:

image

Answer

By default, android uses your colorAccent as the divider color, and your colorAccent is apperantly pink. So, to change it:

1.Go to styles.xml and add this:

<style name="EditTextStyle">
    <item name="colorControlActivated">#YOURCOLOR</item>
</style>

2.Then, on each one of your EditTexts, add the attribute:

style="EditTextStyle"

More info on this SO answer

Comments