1

enter image description here

I want to change the color of arrows that appear when I am editing text in EditText , I don't know the name of these arrows, How can I do that ?

masted
  • 1,211
  • 2
  • 8
  • 14
  • Here's an approach: [Android: Change color / appearance of EditText Select Handle / Anchor](http://stackoverflow.com/a/15133928/2558882). – Vikram Jul 18 '13 at 11:13

2 Answers2

1

You can accomplish this by using a custom theme and setting the following:

<item name="android:textSelectHandle">@drawable/text_select_handle_middle</item>
<item name="android:textSelectHandleLeft">@drawable/text_select_handle_left</item>
<item name="android:textSelectHandleRight">@drawable/text_select_handle_right</item>

Or, you can use reflection:

try {
    final Field fEditor = TextView.class.getDeclaredField("mEditor");
    fEditor.setAccessible(true);
    final Object editor = fEditor.get(editText);

    final Field fSelectHandleLeft = editor.getClass().getDeclaredField("mSelectHandleLeft");
    final Field fSelectHandleRight =
        editor.getClass().getDeclaredField("mSelectHandleRight");
    final Field fSelectHandleCenter =
        editor.getClass().getDeclaredField("mSelectHandleCenter");

    fSelectHandleLeft.setAccessible(true);
    fSelectHandleRight.setAccessible(true);
    fSelectHandleCenter.setAccessible(true);

    final Resources res = context.getResources();

    fSelectHandleLeft.set(editor, res.getDrawable(R.drawable.text_select_handle_left));
    fSelectHandleRight.set(editor, res.getDrawable(R.drawable.text_select_handle_right));
    fSelectHandleCenter.set(editor, res.getDrawable(R.drawable.text_select_handle_middle));
} catch (final Exception ignored) {
}
Jared Rummler
  • 37,824
  • 19
  • 133
  • 148
0

I don't think you can change that without changing the keyboard layout, which will have to be done separately and here are some tutorials on how to do it:

LINK1

LINK2

LINK3

LINK4

LINK5

LINK6

EDIT:

For the hint color, you can also set a red color for example, see if this does the trick:

android:textColorHint="#FF0000"
g00dy
  • 6,752
  • 2
  • 30
  • 43