Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android, how do I stop a pointer appearing below an EditText

I have an activity with some EditTexts in it. When I click on an EditText to change the text in it a blue arrow appears below where the cursor appears. How can I stop this appearing?

Example of annoying blue arrow

like image 784
David Christopher Reynolds Avatar asked Oct 16 '12 08:10

David Christopher Reynolds


1 Answers

As MarvinLabs pointed out, it's a set of drawables in the Android SDK. They can be overridden though.

  1. Find these images in your sdk platform:

    • text_select_handle_left.png
    • text_select_handle_middle.png
    • text_select_handle_right.png
  2. Copy them over to your drawables folder, so you have a local copy to reference. You can change the colors of these, make them empty, or whatever you want. Note that this as MarvinLabs said, it might not be wise to remove them completely because they help the user select text for cutting and copying.

  3. If you don't have a custom theme yet defined in your styles.xml, define one. Then add these items to it:

_

<style name="CustomTheme" parent="@android:style/Theme.Holo.Light">
  <item name="android:textSelectHandleLeft">@drawable/text_select_handle_left</item>
  <item name="android:textSelectHandleRight">@drawable/text_select_handle_right</item>
  <item name="android:textSelectHandle">@drawable/text_select_handle_middle</item>
</style>

BEFORE:

before

AFTER:

after

(different EditTexts but you get the idea)

like image 187
annie Avatar answered Oct 08 '22 16:10

annie