Keyboard style settings-iOS development, keyboard style-ios

Source: Internet
Author: User

Keyboard style settings-iOS development, keyboard style-ios

I. keyboard Style

The UIKit framework supports 8 types of keyboards.

  1. TypedefEnum{
  2. UIKeyboardTypeDefault, // default keyboard: All characters are supported
  3. UIKeyboardTypeASCIICapable, // supports the default ASCII keyboard
  4. UIKeyboardTypeNumbersAndPunctuation, // standard phone keyboard, supporting + * # and other symbols
  5. UIKeyboardTypeURL, // URL keyboard, with. com buttons; only URL characters are supported
  6. UIKeyboardTypeNumberPad, // numeric keypad
  7. UIKeyboardTypePhonePad, // telephone keyboard
  8. UIKeyboardTypeNamePhonePad, // telephone keyboard, also supports the user name
  9. UIKeyboardTypeEmailAddress, // Keyboard used to enter the email address
  10. } UIKeyboardType;

Usage example:

TextView. keyboardtype = UIKeyboardTypeNumberPad;

Ii. keyboard appearance

  1. TypedefEnum{
  2. UIKeyboardAppearanceDefault, // default appearance: light gray
  3. UIKeyboardAppearanceAlert, // dark gray/Graphite
  4. } UIKeyboardAppearance;

Usage example:

TextView. keyboardAppearance = UIKeyboardAppearanceDefault;

Iii. Enter key

  1. Typedef enum {
  2. UIReturnKeyDefault, // default: gray button, marked with Return
  3. UIReturnKeyGo, // the blue button marked with Go
  4. UIReturnKeyGoogle, // the blue button marked with Google for search
  5. UIReturnKeyJoin, // the blue button marked with Join
  6. UIReturnKeyNext, // the blue button marked with Next
  7. UIReturnKeyRoute, // the blue button marked with Route
  8. UIReturnKeySearch, // the blue button marked with Search
  9. UIReturnKeySend, // the blue button marked with Send
  10. UIReturnKeyYahoo, // marked with Yahoo! To search
  11. UIReturnKeyDone, // the blue button marked with Done
  12. UIReturnKeyEmergencyCall, // emergency call button
  13. } UIReturnKeyType;

Usage example:

TextView. returnKeyType = UIReturnKeyGo;

4. Automatic capital

  1. TypedefEnum{
  2. UITextAutocapitalizationTypeNone, // It is not automatically capitalized
  3. UITextAutocapitalizationTypeWords, // uppercase of the first letter of the word
  4. UITextAutocapitalizationTypeSentences, // The first letter of the sentence is capitalized
  5. UITextAutocapitalizationTypeAllCharacters, // all uppercase letters
  6. } UITextAutocapitalizationType;

Usage example:

TextField. autocapitalizationType = UITextAutocapitalizationTypeWords;

5. Automatic Correction

  1. TypedefEnum{
  2. UITextAutocorrectionTypeDefault, // default
  3. UITextAutocorrectionTypeNo, // not automatically corrected
  4. UITextAutocorrectionTypeYes, // automatically corrected
  5. } UITextAutocorrectionType;

Usage example:

TextField. autocorrectionType = UITextAutocorrectionTypeYes;

Vi. Security text input

TextView. secureTextEntry = YES;

Enabling secure input is mainly used for password or private data input. Automatic correction and the cache are disabled.

 

How can I set the keyboard type?

 

Next, see:

Set this method in TextviewDelegate:

// Return NO to disallow editing.-(BOOL) textFieldShouldBeginEditing :( UITextField *) textField {

TextView. keyboardtype = UIKeyboardTypeNumberPad;

// TextField. returnKeyType = UIReturnKeyYahoo; // the same as search // textField. returnKeyType = UIReturnKeyEmergencyCall; // EmergencyCall // textField. returnKeyType = UIReturnKeyGoogle; // the same as search textField. returnKeyType = UIReturnKeyDefault;

}

 

So how can we control the display or hiding of a specific type of button?

Waiting .......


After IOS7 is upgraded, the keyboard is still iOS 6. How can I set the keyboard to iOS 7 in the application?

After iOS7 is upgraded, only those applications provided by Apple, such as memos and information, are iOS 7. For third-party applications that you download and install, if the iOS7-compatible version is not released, the keyboard style should be the same as before. After a while, many applications should be updated to be compatible with iOS7. The keyboard of the latest 5.0.3 version is iOS 7.

I am a beginner in ios development and asked how ios can automatically switch the keyboard.

Ios keyboard settings are generally bound to the properties of the input control. Such as UITextField, UITextView, and UISearchBar.
TextField. keyboardType = UIKeyboardTypeAlphabet;
UIKeyboardType has the following types. The displayed keyboard varies depending on the type you set.

UIKeyboardTypeAlphabet
UIKeyboardTypeASCIICapable
UIKeyboardTypeDecimalPad
UIKeyboardTypeDefault
UIKeyboardTypeEmailAddress
UIKeyboardTypeNamePhonePad
UIKeyboardTypeNumberPad
......

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.