How to change the keyboard type for a text field in Xcode
问题 I created a text field in XCode, not Interface Builder. In IB you can select different keyboard types. How can you do the same thing in XCode? 回答1: How about the keyboardType property? 回答2: 1) In xib you can change by clicking the Keyboard type like below 2) Programmatically you can set by textField.keyboardType = UIKeyboardTypeNumbersAndPunctuation; 来源: https://stackoverflow.com/questions/3790540/how-to-change-the-keyboard-type-for-a-text-field-in-xcode