Domanda

The problem I am faced with, is that the (default) keyboard on iOS is in its first state (default - qwerty) when starting to type in a textfield, and I would like this state to be the (default - number) state, which is seen when the user presses the ".?123" button. Is there any way to set this state initially?

enter image description here

È stato utile?

Soluzione

Use this from your TextFieldDelegate

TextField.keyboardType =UIKeyboardTypeNumbersAndPunctuation;

If you are using IB, change Keyboard type to "Numbers And Punctuation" from attribute inspector

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top