Xamarin.Forms : Focus to the entry and set the cursor after the last character
If you want to make the cursor in Xamarin.Forms Entry blink behind the text you have already typed, instead of in front of it, after focusing, you need to do the following:
Subscribe to the Focused event of the Entry and modify the eventhandler as follows:
public void OnEntryFocused(object sender, EventArgs args)
{
EntryInstance.CursorPosition = EntryInstance?.Text?.Length ?? 0;
}
You can find more information about the CursorPosition at: https://docs.microsoft.com/en-us/dotnet/api/xamarin.forms.entry.cursorposition?view=xamarin-forms
Tags In
Leave a Reply Cancel reply
This site uses Akismet to reduce spam. Learn how your comment data is processed.
Hi, I am András,
I am a seasoned software engineer from Budapest, Hungary with a strong focus on mobile app development using .NET MAUI and Xamarin.Forms. My expertise also extends to website building for my happy customers and other complex system designing. I am passionate about developing well-organized, maintainable software solutions.