Hello,
Welcome to our Microsoft Q&A platform!
You can create entry's custom-renderer for this issue.
[assembly: ExportRenderer(typeof(Entry), typeof(MyEntry))]
namespace App38.Droid
{
class MyEntry : EntryRenderer
{
public MyEntry(Context context) : base(context)
{
}
protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)
{
base.OnElementChanged(e);
if (Control != null)
{
EditText nativeEditText = (global::Android.Widget.EditText)Control;
nativeEditText.SetTextCursorDrawable(Resource.Drawable.xml_file_name);
}
}
}
}
Here is xml_file_name.xml
in Drawable
folder.
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<!-- edit text cursor width 2 dp -->
<size android:width="2dp"/>
<!-- edit text cursor color red -->
<solid android:color="#00ff00"/>
</shape>
</item>
</selector>
Here is running screenshot.
Best Regards,
Leon Lu
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.