views:

21

answers:

1

Hi,

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

+2  A: 

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

textField.keyboardType = UIKeyboardTypeNumberPad;  

to change the keyboard type of a field.

Sander Backus
Thanx really its work for me. thanx again.