IOS 快速查看系统键盘样式

来源:互联网 发布:怎么卸载还原软件 编辑:程序博客网 时间:2024/05/29 12:07
typedef NS_ENUM(NSInteger, UIKeyboardType) {    UIKeyboardTypeDefault,                // Default type for the current input method.    UIKeyboardTypeASCIICapable,           // Displays a keyboard which can enter ASCII characters    UIKeyboardTypeNumbersAndPunctuation,  // Numbers and assorted punctuation.    UIKeyboardTypeURL,                    // A type optimized for URL entry (shows . / .com prominently).    UIKeyboardTypeNumberPad,              // A number pad with locale-appropriate digits (0-9, ۰-۹, ०-९, etc.). Suitable for PIN entry.    UIKeyboardTypePhonePad,               // A phone pad (1-9, *, 0, #, with letters under the numbers).    UIKeyboardTypeNamePhonePad,           // A type optimized for entering a person's name or phone number.    UIKeyboardTypeEmailAddress,           // A type optimized for multiple email address entry (shows space @ . prominently).    UIKeyboardTypeDecimalPad NS_ENUM_AVAILABLE_IOS(4_1),   // A number pad with a decimal point.    UIKeyboardTypeTwitter NS_ENUM_AVAILABLE_IOS(5_0),      // A type optimized for twitter text entry (easy access to @ #)    UIKeyboardTypeWebSearch NS_ENUM_AVAILABLE_IOS(7_0),    // A default keyboard type with URL-oriented addition (shows space . prominently).    UIKeyboardTypeASCIICapableNumberPad NS_ENUM_AVAILABLE_IOS(10_0), // A number pad (0-9) that will always be ASCII digits.    UIKeyboardTypeAlphabet = UIKeyboardTypeASCIICapable, // Deprecated};
  • 新增了第1个Default键盘和第4个URL键盘
  • 删除了Alphabet键盘,替换为Default键盘

1、UIKeyboardTypeDefault
这里写图片描述
常用于文本输入

2、UIKeyboardTypeASCIICapable
这里写图片描述
常用于密码输入
3、UIKeyboardTypeNumbersAndPunctuation
这里写图片描述
主键盘显示如上图,次键盘显示字母
4、UIKeyboardTypeURL
这里写图片描述
适用于网址输入
5、UIKeyboardTypeNumberPad
这里写图片描述

只有数字的数字键盘
6、UIKeyboardTypePhonePad
这里写图片描述

可用于拨号的数字键盘
7、UIKeyboardTypeNamePhonePad
这里写图片描述
主键盘显示如上图,次键盘显示如下图
这里写图片描述

8、UIKeyboardTypeEmailAddress
这里写图片描述

适用于邮件地址输入的键盘
9、UIKeyboardTypeDecimalPad
这里写图片描述

带“点”的数字键盘,可用于带有小数点的数字输入
10、UIKeyboardTypeTwitter
这里写图片描述

11、UIKeyboardTypeWebSearch
这里写图片描述

适用于网页搜索的键盘

原创粉丝点击