

APPLE KEYPAD IPHONE HOW TO
The following list shows how to display each type of keyboard, including the standard keyboard.Īlthough many UIKit objects display the keyboard automatically in response to user interactions, your app still has some responsibilities for configuring and managing the keyboard. These keywords and the pattern attribute are part of HTML 5 and are available in iOS. To display a numeric keyboard, set the value of the pattern attribute to " *" or " \d*". To display a telephone keypad, an email keyboard, or a URL keyboard, use the tel, email, or url keywords for the type attribute on an input element, respectively. You can also control which type of keyboard is displayed when a user touches a text field in a web page. For example, you can include autocorrect and autocapitalize attributes in the definition of an input element to specify the keyboard’s behaviors, as shown in the following example. You can configure some keyboard attributes for text input elements. Figure 4-2 Several different keyboards and input methods Configuring the Keyboard for Web Views Input for some of these keyboards takes place in multiple stages. The input method and layout for the keyboard is determined by the user’s language preferences. To implement the language preferences of different users, iOS also supports different input methods and keyboard layouts for different languages, some of which are shown in Figure 4-2. Figure 4-1 Several different keyboard types However, the phone and numerical keyboards offer a dramatically different layout that is tailored towards numerical input. Most of the other keyboards offer similar features as the default keyboard but provide additional buttons that are specially suited to particular tasks. The default keyboard displays an alphabetical keyboard initially but the user can toggle it and display numbers and punctuation as well.


Figure 4-1 displays the default keyboard along with several other keyboard configurations. The default keyboard configuration is designed for general text input. Setting these properties programmatically or in the Interface Builder inspector window causes the system to display the keyboard of the designated type. The UITextField and UITextView classes both conform to the UITextInputTraits protocol, which defines the properties for configuring the keyboard. You configure the attributes of the keyboard directly through the text objects of your app. Configuring the Keyboard for Text Objects Although your app cannot control the user’s preferred language (and thus the keyboard’s input method), it can control attributes of the keyboard that indicate its intended use, such as the configuration of any special keys and its behaviors. Depending on the needs of your program and the user’s preferred language, the system might display one of several different keyboards. Whenever the user taps in an object capable of accepting text input, the object asks the system to display an appropriate keyboard. Because the keyboard could hide the portion of your view that is the focus of editing, this management might include adjusting the user interface to raise the area of focus so that is visible above the keyboard. You also have to manage the keyboard when the editing session begins and ends. You can configure the type of keyboard that is displayed along with several attributes of the keyboard. When users touch a text field, a text view, or a field in a web view, the system displays a keyboard.
