August 1, 2009

Missing "DONE" button on Number Pad keyboard.

I'm working on an app that uses multiple UITextField controls that have their keyboard type set to "Number Pad." For whatever reason, Apple does not provide a done button for this keyboard type, despite providing one for every other keyboard type.

It seems there are 3 common ways to work around this:

1) Add a button next to the UITextField that is being edited. Only show this button when the keyboard is visible. This sounds like the easiest method, but is a bit ugly.
2) Add a transparent button that covers the entire view. Hide the keyboard when this button is clicked. I'm not sure about the details here. It seems like this would prevent others elements from being clicked, or you'd have to handle the click event for each control on the form.
3) Add a done button to the keyboard. This method probably requires the most work, but definitely provides a better user experience. The keyboard layout has changed slightly between SDK versions 2 and 3, so the OS version needs to be taken into account. The following site has detailed instructions for adding a button to the keyboard:

http://www.neoos.ch/news/46-development/54-uikeyboardtypenumberpad-and-the-missing-return-key

No comments:

Post a Comment