Reputation: 11755
I have a simple question. In an iApp in Japanese I have one UITextField object which do not need Japanese input. Is it possible to disable Japanese-mode input only for this one object. (That would make the input much easier for the user)
I have already tried:
myTextField.autocorrectionType=UITextAutocorrectionTypeNo;
and it does not work.
Thanks for any tip.
Upvotes: 0
Views: 850
Reputation: 4718
UITextField has keyboardType property. When the keyboardType is set to UIKeyboardTypeDefault, Japanese keyboard could be shown as a default keyboard.
typedef enum {
UIKeyboardTypeDefault,
UIKeyboardTypeASCIICapable,
UIKeyboardTypeNumbersAndPunctuation,
UIKeyboardTypeURL,
UIKeyboardTypeNumberPad,
UIKeyboardTypePhonePad,
UIKeyboardTypeNamePhonePad,
UIKeyboardTypeEmailAddress,
UIKeyboardTypeDecimalPad,
UIKeyboardTypeTwitter,
UIKeyboardTypeAlphabet = UIKeyboardTypeASCIICapable
} UIKeyboardType;
To set keyboadType Programmatically, you can use setKeyboardType as folows:
[myTextField setKeyboardType:UIKeyboardTypeASCIICapable];
The document is here:
Upvotes: 2