1

I cannot figure out how to change the default coloring of editText from pink to blue. I managed to change the underline using:

android:backgroundTint="@color/blue"

Here is my current XML for me editText box

<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:text="@string/customword"
android:ems="10"
android:id="@+id/customword"
android:layout_gravity="start"
android:tint="@color/blue"
android:textAlignment="viewStart"
android:textSize="14sp"
android:textColorLink="@color/blue"  //no affect
android:textColorHint="@color/blue" //no affect
android:textColorHighlight="@color/blue" //no affect
android:backgroundTint="@color/blue"
tools:ignore="UnusedAttribute" />

Here are some screenshots for the aspects I want to change from pink: enter image description here

Pink Bubble

Pink Line

Cœur
  • 32,421
  • 21
  • 173
  • 232
Jack Foulkes
  • 103
  • 1
  • 13
  • 1
    Possible duplicate of [Set EditText cursor color](http://stackoverflow.com/questions/7238450/set-edittext-cursor-color) – nikis Dec 13 '16 at 21:03

2 Answers2

2

The cursor (and bubble) color should match your colorAccent, so set your accent color to the color you would like to use:

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/blue</item>
</style>

Or, if you would prefer to only change the accent color for the EditText, you can use a theme overlay:

<style name="AppTheme.EditTextOverlay" parent = "ThemeOverlay.AppCompat.Light">
    <item name="colorAccent">@color/blue</item>
</style>

Then apply it to your EditText:

<EditText android:id="@+id/customword"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="start"
    android:inputType="textPersonName"
    android:text="@string/customword"
    android:ems="10"
    android:textAlignment="viewStart"
    android:textSize="14sp"
    android:theme="@style/AppTheme.EditTextOverlay" />
Bryan
  • 13,244
  • 9
  • 62
  • 114
0

I found this answer here, does this solve your issue?

Setting the android:textCursorDrawable attribute to @null should result in the use of android:textColor as the cursor color.

Community
  • 1
  • 1
slayerpjo
  • 173
  • 9