Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android edit text cursor is not visible?

 <shape xmlns:android="http://schemas.android.com/apk/res/android"
 android:shape="rectangle">
 <solid android:color="#ffffff" />    
 <stroke android:width="1dp" 
  android:color="#000000" />
 </shape>  

I am using this code in setBackgroundResource(R.drawable.selfbg); While I am using this code the cursor is not visible in Edittext.

like image 889
Anupama Avatar asked Jan 28 '14 05:01

Anupama


4 Answers

Did you try?

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

like image 120
Luc Avatar answered Sep 19 '22 13:09

Luc


try to add below into EditText:

 android:textCursorDrawable="@null"
 android:background="@null"
like image 43
M D Avatar answered Sep 20 '22 13:09

M D


try:

 <item name="android:textCursorDrawable">@null</item>

It requires API-12 and above though.

like image 45
vipul mittal Avatar answered Sep 18 '22 13:09

vipul mittal


<EditText  
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:textCursorDrawable="@drawable/color_cursor"
    android:background="@drawable/R.drawable.selfbg"/>


Than create drawalble xml: color_cursor

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
    <size android:width="2dp" />
    <solid android:color="#000000"  />
</shape>
like image 35
Ravv Avatar answered Sep 19 '22 13:09

Ravv