0

I want to customize the EditText slider style. See my screenshots below.

This is the default slider style:

This is the default cursor Style

This is what I want to see:

This is the cursor style I want to customize.

This may be a dumb question, but after a few hours Googling, I can only find ways to change the cursor color, but couldn't find an approach to change the slider style.

This is the code I am using for changing the cursor color (color_cursor.xml):

<?xml version="1.0" encoding="utf-8" ?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
  <size android:width="2dp" />
  <solid android:color="#008000" />
</shape>

And I applied the "android:textCursorDrawable="@drawable/color_cursor" to EditText.

Thanks.

LiuWenbin_NO.
  • 1,216
  • 1
  • 16
  • 25

2 Answers2

1
android:textSelectHandle="@drawable/your_desired_drawable"

put this in your editText view. Set the drawable you prefer. Then change the color inside your drawable xml file.

Divole
  • 101
  • 1
  • 5
0

An answer for myself (hope this will also help others): After introducing the "Theme.material", the EditText will become the expected style. I will want to check out Material Design.

LiuWenbin_NO.
  • 1,216
  • 1
  • 16
  • 25