带小数分隔符的数字键盘

Joh*_*ith 12 iphone keyboard objective-c uitextfield

如何使用小数分隔符获取数字键盘?目前我被UIKeyboardNumberPad困住了.

dec*_*ohn 10

你可以试试这个

UIKeyboardTypeDecimalPad


Sim*_*ide 7

typedef enum {
   UIKeyboardTypeDefault,
   UIKeyboardTypeASCIICapable,
   UIKeyboardTypeNumbersAndPunctuation,
   UIKeyboardTypeURL,
   UIKeyboardTypeNumberPad,
   UIKeyboardTypePhonePad,
   UIKeyboardTypeNamePhonePad,
   UIKeyboardTypeEmailAddress,
   UIKeyboardTypeDecimalPad,
   UIKeyboardTypeTwitter,
   UIKeyboardTypeWebSearch,
   UIKeyboardTypeAlphabet = UIKeyboardTypeASCIICapable // Deprecated
} UIKeyboardType;
Run Code Online (Sandbox Code Playgroud)

如果您不喜欢这些,您可以随时在代码中修改它们...

http://openradar.appspot.com/6635276

这有一个解决方案:http: //www.iphonedevsdk.com/forum/iphone-sdk-development/6573-howto-customize-uikeyboard.html

  • 我知道这是一个古老的话题,但是遇到这个的人应该注意到,从iOS 4.1开始,在该枚举中定义了一个名为UIKeyboardTypeDecimalPad的新UIKeyboardType. (15认同)