Yasir Abbas
Yasir Abbas

Reputation: 11

how can i change the keyboard at runtime in iphone

how can i change the keyboard at runtime in iphone?

i have a Bar segmented control in which i have two options like "name" and "Phone no". And i have i textbox. I want when user selects "name" and type in textbox then a default

keyboard should display but when user selects "phone no" and type in textbox then a "number pad" keyboard should display.

Plz help me.

Regards Mike

Upvotes: 0

Views: 258

Answers (1)

Saa
Saa

Reputation: 1615

This is defined in the UITextInputTraits Protocol Reference. You can use

textField.keyboardType = UIKeyboardTypeNumberPad;  

to change the keyboard type of a field.

Upvotes: 3

Related Questions