Knowledge about uikeyboard keyboards-iOS development

Source: Internet
Author: User

I. keyboard Style

The uikit framework supports 8 types of keyboards.

Typedef Enum {uikeyboardtypedefault, // default keyboard: supports all characters uikeyboardtypeasciicapable, // supports ASCII default keyboard uikeyboardtypenumbersandpunctuation, // standard phone keyboard, supports + * # and other symbols uikeyboardtypeurl, // URL keyboard,. com button; supports only the URL character uikeyboardtypenumberpad, // The digital keyboard uikeyboardtypephonepad, // The telephone keyboard uikeyboardtypenamephonepad, // The telephone keyboard, and the input name uikeyboardtypeemailaddress, // enter the keyboard for the email address} uikeyboardtype;

Usage example:

Textview. keyboardtype = uikeyboardtypenumberpad;

Ii. keyboard appearance

Typedef Enum {uikeyboardappearancedefault, // default appearance: light gray uikeyboardappearancealert, // dark gray/graphite} uikeyboardappearance;

Usage example:

Textview. keyboardappearance = uikeyboardappearancedefault;

Iii. Enter key

  1. Typedef Enum {
  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:

Textview. returnkeytype = uireturnkeygo;

4. Automatic capital

Typedef Enum {uitextautocapitalizationtypenone, // The uitextautocapitalizationtypewords are not automatically capitalized, // The first letter of the word is capitalized, // The first letter of the sentence is capitalized, // all letters are capitalized} uitextautocapitalizationtype;

Usage example:

Textfield. autocapitalizationtype = uitextautocapitalizationtypewords;

5. Automatic Correction

Typedef Enum {uitextautocorrectiontypedefault, // uitextautocorrectiontypeno by default, // uitextautocorrectiontypeyes is not automatically corrected, // automatic correction} 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.

VII. keyboard cover View

This problem has been around for a long time. I wrote a special article to solve this problem. Please smile: how to solve the problem of opening the keyboard to cover the view

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.