UITextField、UITextView等能够调出系统键盘的控件,通过下面这个属性可以控制弹出键盘的样式:
self.priceTextField.keyboardType = UIKeyboardTypeDecimalPad;
下面枚举下,常见的13种键盘样式
1.UIKeyboardTypeDefault(当前输入法的默认类型)

2.UIKeyboardTypeASCIICapable(显示一个可以输入ASCII字符的键盘)

3.UIKeyboardTypeNumbersAndPunctuation(数字和分类标点符号)

4.UIKeyboardTypeURL(为URL条目优化的类型(显著的显示“.”、“/”、“.com”))

5.UIKeyboardTypeNumberPad(只能输入整数)

6.UIKeyboardTypePhonePad(适用于拨号)

7.UIKeyboardTypeNamePhonePad(为输入某人的姓名或电话号码而优化的一种类型)

8.UIKeyboardTypeEmailAddress(为多个电子邮件地址条目优化的类型(显著的显示@))

9.UIKeyboardTypeDecimalPad(带小数点的数字键盘)

10.UIKeyboardTypeTwitter(一种优化的Twitter文本条目(易于使用@))

11.UIKeyboardTypeWebSearch(输入URL条目推荐的键盘样式,显著的显示Go、搜索)

12.UIKeyboardTypeAlphabet == UIKeyboardTypeASCIICapable(官方不建议使用)

13、UIKeyboardTypeASCIICapableNumberPad(iOS10后出现的数字键盘)
