I need the UITextField "ASCII Capable" keyboard to come up in numeric mode. I can't find an API for this, what am I missing?
from the documentation does this help?
The appearance of the keyboard itself can be customized using the properties provided by the UITextInputTraits protocol. Text field objects implement this protocol and support the properties it defines. You can use these properties to specify the type of keyboard (ASCII, Numbers, URL, Email, and others) to display. You can also configure the basic text entry behavior of the keyboard, such as whether it supports automatic capitalization and correction of the text.
Are you using Interface Builder? If so, click on the text field, then go to the Text Field Attributes. There will be an attribute for Keyboard. Change it to Number Pad.
Assuming you have a UITextField
named textField
, all you need to do is call the method:
[ textField setKeyboardType:UIKeyboardTypeNumbersAndPunctuation ];
You may need to call this before the keyboard is displayed.