How to set number side as default (while keyboard is open) of name phone pad keyboard type

后端 未结 2 1817
逝去的感伤
逝去的感伤 2021-02-19 08:45

Right now when the keyboard launches on my application it defaults to the letter side showing an alphabetical keyboard.

Question will be listed below images

2条回答
  •  广开言路
    2021-02-19 09:13

    To switch the Keyboardlayout programmatically you have to mutate UITextfield's keyboardType attribute.

    Try

    textField.keyboardType = UIKeyboardType.NumberPad;
    

    or

    textField.keyboardType = UIKeyboardType.PhonePad;
    

提交回复
热议问题