George Friday George Friday - 1 year ago 84
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 Source

I think you can do something like:

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

See the UIAlertView and UITextInputTraits docs