[英]how to change keyboard style programmatically in iOS?
试试这个来改变键盘类型:
self.someTextField.keyboardType = UIKeyboardType.decimalPad
对于具有特殊字符的数字,请尝试以下操作:-
UIKeyboardType.numbersAndPunctuation
来自:- https://developer.apple.com/documentation/uikit/uitextinputtraits#//apple_ref/c/tdef/UIKeyboardType
以及感谢您的建议和答案。
我找到了解决方案。
对于数字
textField.keyboardType = UIKeyboardType.numbersAndPunctuation
对于字母
textField.keyboardType = UIKeyboardType.emailAddress
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.