Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Xamarin.Forms iOS Numeric Keyboard With 'Done' Button
using Xamarin.Forms;
namespace YourNamespace.Controls
public class ExtendedEntry : Entry { }
Based on example from:
using System.Drawing;
using YourNamespace.Controls;
using YourNamespace.iOS.Renderers;
using UIKit;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
[assembly: ExportRenderer(typeof(ExtendedEntry), typeof(ExtendedEntryRenderer))]
namespace YourNamespace.iOS.Renderers
public class ExtendedEntryRenderer : EntryRenderer
protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)
if (Element == null)
// Check only for Numeric keyboard
if (this.Element.Keyboard == Keyboard.Numeric)
/// <summary>
/// <para>Add toolbar with Done button</para>
/// </summary>
protected void AddDoneButton()
var toolbar = new UIToolbar(new RectangleF(0.0f, 0.0f, 50.0f, 44.0f));
var doneButton = new UIBarButtonItem(UIBarButtonSystemItem.Done, delegate
var baseEntry = this.Element.GetType();
toolbar.Items = new UIBarButtonItem[] {
new UIBarButtonItem (UIBarButtonSystemItem.FlexibleSpace),
this.Control.InputAccessoryView = toolbar;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment