Hello, I'm trying the following with no luck. When the user click on a UiTextfield i need to change the keyboard view to the numeric view automatically, is this possible? Thanks in advance.
+5
A:
The UITextInputTraits
protocol (which UITextField
conforms to) has a keyboardType
property of type UIKeyboardType
.
myTextField.keyboardType = UIKeyboardTypeNumberPad;
Jacob Relkin
2010-09-26 06:10:38
thank you very much!
Pablo
2010-09-27 02:25:55
+2
A:
UITextField conforms to UITextInputTraits protocol which means it has keyboardType property which you can set.
myField.keyboardType = UIKeyboardTypeNumberPad;
You can also set it via interface builder. From the text input traits set the keyboard to number pad and that's all.
taskinoor
2010-09-26 06:19:26