I'm currently developing an application with a primarily Japanese (secondary English) market, and I've found that I cannot set UIKeyboardType
for a textfield and get it to actually work if using a tenkey/flick style Japanese keyboard. Even though the UIKeyboardType
should be responding appropriately,
userIdField = [[[UITextField alloc] initWithFrame:CGRectMake(120, 5, 185, 35)]autorelease];
userIdField.delegate = self;
userIdField.keyboardType = UIKeyboardTypeASCIICapable;
userIdField.autocorrectionType = UITextAutocorrectionTypeNo;
userIdField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
userIdField.returnKeyType = UIReturnKeyDone;
userIdField.autocapitalizationType = UITextAutocapitalizationTypeNone;
userIdField.backgroundColor = [UIColor clearColor];
[cell addSubview:userIdField];
when I tap the textfield it will open up the default Japanese tenkey style keyboard. I have tried UIKeyboardTypeASCIICapable
, UIKeyboardTypeURL
, UIKeyboardTypeEmailAddress
, UIKeyboardTypeNamePhonePad
and they always show the default tenkey Japanese keyboard. I know that the code is being read, as setting UIKeyboardTypePhonePad
works without flaw, but for some reason the phone will not display anything but the default Japanese tenkey keyboard.
Is there any way to fix this, or is this a bug that has existed since the dawn of time? How do I force the user to use a keyboard which can ONLY input alphabet,number,"_/. characters?
Using a Hangul (Korean) keyboard, it works sporadically- ASCII keyboard comes up fine, url keyboard comes up Hangul with a .com button. For ASCIICapable, looking at the UITextInputTraits.h file, it says:
UIKeyboardTypeASCIICapable, // Displays a keyboard which can enter ASCII characters, non-ASCII keyboards remain active
Which doesn't make any sense as both Hangul and Japanese are non-ASCII, but Hangul + ASCIICapable = ASCII (though it should be Hangul as it is non-ascii), whereas Japanese tenkey + ASCIICapable = Japanese tenkey.
I saw other posts about changing keyboard language programmatically, which cannot be done, but this question is a more focused on asking why the kind of keyboard specified by UIKeyboardType doesn't show up.