Search code examples
androidandroid-edittext

How can I change Edit Text´s selection color?


Description:

When you keep pressed an edit text (in order to select text), an indicator appears (i don´t know it´s name).

enter image description here

Question:

How can i edit it´s color?

Thanks so much for reading.


Solution

  • Write this to your style.xml

    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
         <!-- change values below to make same eefect for all EditTexts ->
        <item name="colorControlNormal">#c5c5c5</item>
        <item name="colorControlActivated">@color/accent</item>
        <item name="colorControlHighlight">@color/accent</item>
    </style>
    <!-- also you can create different styles with values above for many different views ->