New to Telerik UI for Xamarin? Download free 30-day trial

Change Entry Cater Color when on focus


Product Version 2021.3.915.1
Product Entry for Xamarin Cross-Platform


This article shows how to change the Entry cursor / caret color on Android when the control receives focus.


You will need a Custom Renderer for Android.

  1. Entry definition:
    <input:RadEntry WatermarkText="Telerik Entry"/>
  1. Inside the Android/Resources/drawable folder create a my_cursor.xml file for the caret / cursor
<shape xmlns:android=""

  <solid android:color="@color/colorCursors"></solid>
  <size android:width="2dp" />

  1. Add a color for the cursor - colorCursor inside colors.xml file inside the Android/Resources/values folder:
    <color name="launcher_background">#FFFFFF</color>
    <color name="colorPrimary">#3F51B5</color>
    <color name="colorPrimaryDark">#303F9F</color>
    <color name="colorAccent">#FF4081</color>

    <color name="colorCursors">#303F9F</color>
  1. Create a Custom Renderer on Android. Class CustomEntryRenderer which inherits from EntryRenderer.

In oder to change the caret / cursor color override the OnElementChanged method and inside it call the SetTextCursorDrawable method to change the cursor color and consume the resource:

using Android.Content;
using Android.Content.Res;
using Android.Graphics.Drawables;
using Android.Runtime;
using Android.Text;
using Android.Widget;
using ListPicker.Droid;
using Telerik.XamarinForms.Input;
using Telerik.XamarinForms.InputRenderer.Android;
using Xamarin.Forms;

[assembly: ExportRenderer(typeof(RadEntry), typeof(CustomEntryRenderer))]

namespace ListPicker.Droid
    public class CustomEntryRenderer : EntryRenderer
        public CustomEntryRenderer(Context context) : base (context)


        protected override void OnElementChanged(Xamarin.Forms.Platform.Android.ElementChangedEventArgs<RadEntry> e)

            if (this.Control != null)
In this article