I have a a textField object in my iPad app. I would like to give the user a convenient keyboard for entering numbers. In my code I added:
UITextField *textField = [[UITextField alloc] initWithFrame:frame];
textField.keyboardType = UIKeyboardTypeDecimalPad;
According to the docs this is a valid keyboard type but when I edit the text field the normal ASCII keyboard comes up. However, when I change it to:
textField.keyboardType = UIKeyboardTypePhonePad;
The keyboard looks like this:
Ideally I would like a keyboard that only has the numbers and decimal point but is this not possible on the iPad? Does anyone have a definitive list of which keyboards work on the iPhone vs. iPad? Apple is unclear on this point. I also saw this question which is similar but none of the answers really address my point.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…