How to change the keyboard type for a text field in Xcode

拜拜、爱过 提交于 2019-12-10 18:56:54

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!