1

the cursor is not display in 4.4 in Edit text. My code is below of the xml :

 <EditText
                android:id="@+id/editextTitle"
                style="@style/WrapMid_edittext"
                android:hint="Search"
                android:singleLine="true" />
Kuldip Sharma
  • 782
  • 1
  • 6
  • 8

3 Answers3

1

To change cursor color you need to create a drawable as below (cursor.xml):

<?xml version="1.0" encoding="utf-8"?>

<solid android:color="@color/cursor_color" />

<size android:width="1dp" />

and use it as

                <EditText
                android:id="@+id/editextTitle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                style="@style/WrapMid_edittext"
                android:hint="Search"
                android:singleLine="true"
                android:textCursorDrawable="@drawable/cursor"/>
Karan Rana
  • 638
  • 4
  • 14
0

You question is very general, you should be more specific but I guess that I understood what you meant in that question.

android:textCursorDrawable="@null"

Add this simple line and it should fix your problem. You could trick with this code and change the colour of the cursor as you prefer.

Look here if you want a reference guide and if you scroll down, I'd invite you to focus on this:

enter image description here

Alberto Rossi
  • 1,800
  • 4
  • 36
  • 58
0

Your edit text should be like this

          <EditText
            android:id="@+id/editextTitle"
            style="@style/WrapMid_edittext"
            android:hint="Search"
            android:textCursorDrawable="@null"
            android:singleLine="true" />

Still facing the problem .. look here

Community
  • 1
  • 1
King of Masses
  • 18,405
  • 4
  • 60
  • 77