UIKeyboardType Enum
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
An enumeration of keyboard types.
[ObjCRuntime.Native]
public enum UIKeyboardType
[<ObjCRuntime.Native>]
type UIKeyboardType =
- Inheritance
-
UIKeyboardType
- Attributes
Fields
| Name | Value | Description |
|---|---|---|
| Default | 0 | The default keyboard for the current input type. |
| AsciiCapable | 1 | Displays standard ASCII characters. |
| ASCIICapable | 1 | Displays standard ASCII characters. |
| NumbersAndPunctuation | 2 | Numbers and punctuation. |
| Url | 3 | Characters, '.', '/', and '.com' keys, and access to numbers and punctuation. |
| NumberPad | 4 | Numbers. |
| PhonePad | 5 | Numbers plus access to #, *, 'pause', and 'wait'. |
| NamePhonePad | 6 | Characters plus access to numbers. |
| EmailAddress | 7 | Characters, an @ symbol, and access to numbers and punctuation. |
| DecimalPad | 8 | Displays numbers and decimal point. |
| 9 | Characters, @ and # keys, and access to numbers and punctuation. |
|
| WebSearch | 10 | Optimized for Web search terms and URL entry. |
| AsciiCapableNumberPad | 11 | Displays numbers and decimal point by using standard ASCII characters. |
Remarks
In order to change the keyboard appearance, the currently displaying keyboard must be dismissed. This is achieved by having the UIControl associated with the keyboard resigning as first responder, changing the keyboard type, and then re-subscribed as the first subscriber, as shown in the following code:
void AddKeyboardTypeButton (UIKeyboardType kbType, RectangleF frame)
{
var kbButton = UIButton.FromType (UIButtonType.RoundedRect);
kbButton.Frame = frame;
kbButton.SetTitle (kbType.ToString (), UIControlState.Normal);
View.AddSubview (kbButton);
kbButton.TouchUpInside += (sender, e) => {
myTextField.ResignFirstResponder ();
myTextField.KeyboardType = kbType;
myTextField.BecomeFirstResponder ();
};
}