[英]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.