George Friday
George Friday

Reputation: 585

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.

Upvotes: 10

Views: 5748

Answers (1)

NG.
NG.

Reputation: 22904

I think you can do something like:

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

See the UIAlertView and UITextInputTraits docs

Upvotes: 42

Related Questions