0

I need to popup a keyboard when the user hits on a UITextField. I understand that this is done automatically. But the Keyboard i require should have the .com , @ signs in it. Like in the Facebook application for iOS.

How can i add this Keyboard ? And what is it called ?

Illep
  • 16,375
  • 46
  • 171
  • 302
  • You can find your answer by visiting http://stackoverflow.com/questions/7301018/programmatically-change-uitextfield-keyboard-type - set as UIKeyboardTypeEmailAddress – Dan Hanly Mar 20 '12 at 16:04

3 Answers3

3

Your answer can be found here: Programmatically change UITextField Keyboard type

To summarise...

You can change the keyboard type by doing the following:

[textField setKeyboardType:(TYPE)];

Replacing (TYPE) with one of the following:

UIKeyboardTypeDefault,                // Default type for the current input method.
UIKeyboardTypeASCIICapable,           // Displays a keyboard which can enter ASCII characters, non-ASCII keyboards remain active
UIKeyboardTypeNumbersAndPunctuation,  // Numbers and assorted punctuation.
UIKeyboardTypeURL,                    // A type optimized for URL entry (shows . / .com prominently).
UIKeyboardTypeNumberPad,              // A number pad (0-9). Suitable for PIN entry.
UIKeyboardTypePhonePad,               // A phone pad (1-9, *, 0, #, with letters under the numbers).
UIKeyboardTypeNamePhonePad,           // A type optimized for entering a person's name or phone number.
UIKeyboardTypeEmailAddress            // A type optimized for multiple email address entry (shows space @ . prominently).

The one you are looking for (shows @ and .com) is UIKeyboardTypeEmailAddress

Community
  • 1
  • 1
Dan Hanly
  • 7,829
  • 13
  • 73
  • 134
1

implement this

-(void)textFieldDidBeginEditing:(UITextField *)sender{
[textField setKeyboardType:UIKeyboardTypeEmailAddressL];
}
Ankit Srivastava
  • 12,347
  • 11
  • 63
  • 115
1

If you created your UITextField using interface builder, then navigate to the attributes inspector and change Keyboard to E-mail Address.

If you created it programmatically then add this

[yourTextField setKeyboardType:UIKeyboardTypeEmailAddress];

or

yourTextField.keyboardType=UIKeyboardTypeEmailAddress;
EagerMike
  • 2,032
  • 1
  • 24
  • 40