android edittext cursor color

android edittext cursor color

android edittext cursor color

android edittext cursor color tutorial focus on how to set color of your cursor in android edittext. you might be wondering that how automatically android is taking color for android edittext cursor and unable to find the method to set cursor color. Check out sample code to change color in android.

Android Method 1 to change color:

<EditText
android:layout_width=”fill_parent”
android:layout_height=”wrap_content”
android:textCursorDrawable=”@drawable/color_cursor_drawable”
/>

Drawable for cursor color
<?xml version=”1.0″ encoding=”utf-8″?>
<shape xmlns:android=”http://schemas.android.com/apk/res/android” >
<size android:width=”3dp” />
<solid android:color=”#FFFFFF”  />
</shape>

Android Method 2 to change color:

Set android:textCursorDrawable to null and set your android:textColor

Hope you my android tutorial article help you, For more article check out any of the following link and don’t forget to subscribe to get my article by email.

android edittext validation example

android textview center

android textview underline

android developer tips and tricks

Adarsh Patel

My Self Adarsh Suryakant Patel. Currently I am working as Assistant Professor at Parul Instiute of Engineering and Technology, MCA Department, Limda, Vadodara. Major Responsibility : * Lectures * Organizing Training and Expert Sessions for * Placement and Recruitment * Faculty Representative