George Friday George Friday - 4 months ago 16
Objective-C Question

Change type of UIAlertView keyboard

How do I specify that my keyboard for the

UIAlertView
text field is to be a number pad keyboard? I am setting
alertViewStyle
to
UIAlertViewStylePlainTextInput
.

NG. NG.
Answer

I think you can do something like:

UITextField* tf = [alertView textFieldAtIndex:0];
tf.keyboardType = UIKeyboardTypeNumberPad;

See the UIAlertView and UITextInputTraits docs

Comments