Custom induction of iOS keyboard types

Source: Internet
Author: User

Custom induction of iOS keyboard types

Sometimes we cannot display the mobile phone and keyboard on the Xcode virtual machine, because we have not set the keyboard correctly:

You can do this: Make sure that the third box is also marked with a pair (Toggle Software Keyboard)

I. keyboard Style

Supports 8 types of keyboards.

  1. TypedefEnum {
  2. UIKeyboardTypeDefault, //Default keyboard: All characters are supported.
  3. UIKeyboardTypeASCIICapabLe, //Supports ASCII default keyboards
  4. UIKeyboardTypeNumbersAndPunctuation, //Standard phone keyboard, supporting + * # and other symbols
  5. UIKeyboardTypeURL, //URL keyboard with A. com button; only URL characters are supported
  6. UIKeyboardTypeNumberPad, // Numeric keypad
  7. UIKeyboardTypePhonePad, //Telephone keyboard
  8. UIKeyboardTypeNamePhonePAd, //Phone keyboard, user name supported
  9. UikeyboardtypeemailaddhSs, //Keyboard used to enter the email address
  10. }UIKeyboardType;

    Usage example:

    TextField. keyboardtype =UIKeyboardTypeNumberPad;

    Ii. keyboard appearance

    1. TypedefEnum {
    2. UIKeyboardAppearanceDefaUlt, //Default appearance: light gray
    3. UIKeyboardAppearanceAlerT, // Dark gray/Graphite
    4. }UIKeyboardAppearance;

      Usage example:

      TextField. keyboardAppearance = UIKeyboardAppearanceDefaUlt;

      Iii. Enter key

      1. TypedefEnum {
      2. UIReturnKeyDefault,// Default value: the 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,// 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:

        TextField. returnKeyType = UIReturnKeyGo;

        4. Change the input box to the password box

        TextField. secureTextEntry = Yes;

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.