How can I get the numeric keyboard with the decimal separator? Currently I am stuck with UIKeyboardNumberPad.
typedef enum {
UIKeyboardTypeDefault,
UIKeyboardTypeASCIICapable,
UIKeyboardTypeNumbersAndPunctuation,
UIKeyboardTypeURL,
UIKeyboardTypeNumberPad,
UIKeyboardTypePhonePad,
UIKeyboardTypeNamePhonePad,
UIKeyboardTypeEmailAddress,
UIKeyboardTypeAlphabet = UIKeyboardTypeASCIICapable
} UIKeyboardType;
If you don't like those, you can always modify them in code...
http://openradar.appspot.com/6635276
This has a solution: http://www.iphonedevsdk.com/forum/iphone-sdk-development/6573-howto-customize-uikeyboard.html
The iPhone SDK currently does not offer a keypad (0-9) + decimal button UIKeyboard. I suspect this was designed because for the majority of use cases, it is not needed.
See this previous StackOverflow question discussing the (lack of) need for a decimal separator for currency inputs. I also wrote a blog post about this very topic.
However, if you really do need a keypad + decimal button keyboard, your only option will be to roll your own custom keyboard. Contrary sbwoodside's answer, you really want to shy away from customizing the existing UIKeyboard. While this may be easy to do, it relies upon private classes that can change anytime...meaning your hack could break in the future without warning.
The UIKeyboardTypeNumbersAndPunctuation
is probably the least-bad option, unless you have the time and resources to roll your own keyboard.
does not offer a keypad (0-9) + decimal button UIKeyboard. I suspect this was designed because for the majority of use cases it is not needed.
Not needed?
I would use it in EVERY textfield that needs a dollars/cents value.... and every decimal value.