IOS numeric keypad does not have a done button like how they have it in android

Manickam, Suraj 365 Reputation points
2026-01-13T07:21:14.98+00:00

Android :

image

IOS :

image

I tried a lot of things including the ones mentioned here in github https://github.com/dotnet/maui/issues/19550and i also tried my own but all i could see is only the done button without the numeric keypad , is there an easy way to do it without having to touch all the entries ? It would be nice if it can be done using handlers.

Developer technologies | XAML
Developer technologies | XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
0 comments No comments
{count} votes

Answer accepted by question author
  1. Michael Le (WICLOUD CORPORATION) 10,760 Reputation points Microsoft External Staff Moderator
    2026-01-13T10:15:54.34+00:00

    Hello @Manickam, Suraj ,

    Although Apple doesn’t include this button by default, it was added in .NET MAUI after this commit: https://github.com/dotnet/maui/commit/e6f3c755d04c1269e357e0de5376fad93a5b70f3.

    Your implementation looks great. But if possible, please consider updating to the latest .NET MAUI version to take advantage of this feature and to receive better support in the future.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Manickam, Suraj 365 Reputation points
    2026-01-13T07:25:49.4833333+00:00

    Oh this worked

    using UIKit;
    using Microsoft.Maui.Handlers;
    using Microsoft.Maui.Controls;
    using Microsoft.Maui.Platform;
    
    namespace App.Platforms.IOS.EntryDone
    {
        public class EntryDoneHandler : EntryHandler
        {
            protected override void ConnectHandler(MauiTextField textField)
            {
                base.ConnectHandler(textField);
    
                if (VirtualView is Entry entry &&
                    (entry.Keyboard == Keyboard.Numeric))
                {
                    AttachDoneToolbar(textField);
                }
            }
    
            private void AttachDoneToolbar(MauiTextField textField)
            {
                // 1. Specify a frame. iOS needs a defined height to properly 
                // render the toolbar ABOVE the keypad rather than replacing it.
                var toolbar = new UIToolbar(new CoreGraphics.CGRect(0, 0, UIScreen.MainScreen.Bounds.Width, 44))
                {
                    BarStyle = UIBarStyle.Default,
                    Translucent = true
                };
    
                var doneButton = new UIBarButtonItem(UIBarButtonSystemItem.Done, (s, e) =>
                {
                    textField.ResignFirstResponder();
                    // Optional: manually fire the Completed event
                    VirtualView?.Completed();
                });
    
                var flexSpace = new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace);
    
                toolbar.SetItems(new[] { flexSpace, doneButton }, animated: false);
    
                // 2. Assign to InputAccessoryView (NOT InputView)
                textField.InputAccessoryView = toolbar;
    
                // 3. Ensure the keypad type is correct
                // If this is set to UIKeyboardType.Default, it might hide the numpad.
                if (textField.KeyboardType == UIKeyboardType.Default)
                {
                    textField.KeyboardType = UIKeyboardType.NumberPad;
                }
            }
        }
    }
    
    
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.