6

为“邮政编码/邮政编码”字段创建了一个 UITextField,其键盘类型为 UIKeyboardTypeDefault。我想使用默认键盘,但希望数字和符号默认显示为与字母相对。

当您在 Contacts.app 中输入地址时,Apple 会执行此操作。

有谁知道如何完成这个?

4

2 回答 2

9

你想要UIKeyboardTypeNumbersAndPunctuation键盘类型。

于 2010-04-22T23:37:06.180 回答
6

以及 executor21 所说的代码示例:

UITextField* txt = [[UITextField alloc] init];
txt.keyboardType = UIKeyboardTypeNumbersAndPunctuation;
于 2010-04-22T23:41:23.787 回答