iOS keyboard style/style

Source: Internet
Author: User

First, the keyboard style

The Uikit Framework supports 8 styles of keyboards.

  1. typedef enum {
  2. Uikeyboardtypedefault, //default keyboard: All characters supported
  3. Uikeyboardtypeasciicapable, //ASCII-enabled default keyboard
  4. Uikeyboardtypenumbersandpunctuation, //Standard telephone keypad, supports +* #等符号
  5. Uikeyboardtypeurl, //URL keyboard with. com button; URL characters only
  6. Uikeyboardtypenumberpad, //numeric keypad
  7. Uikeyboardtypephonepad, //Telephone keypad
  8. Uikeyboardtypenamephonepad, //telephone keypad, also support input person name
  9. Uikeyboardtypeemailaddress, //keyboard for entering e-mail addresses
  10. } Uikeyboardtype;

Usage Use cases:

Textview.keyboardtype = Uikeyboardtypenumberpad;

Second, keyboard appearance

    1. typedef enum {
    2. Uikeyboardappearancedefault, //default appearance: Light grey
    3. Uikeyboardappearancealert, //dark grey/graphite
    4. } uikeyboardappearance;

Usage Use cases:

Textview.keyboardappearance=uikeyboardappearancedefault;

Third, enter

    1. typedef ENUM {
    2. Uireturnkeydefault,//default: Gray button, marked with return
    3. Uireturnkeygo,//blue button labeled Go
    4. Uireturnkeygoogle,//blue button labeled Google for search
    5. Uireturnkeyjoin,//blue button labeled Join
    6. Uireturnkeynext,//blue button labeled Next
    7. Uireturnkeyroute,//blue button labeled route
    8. Uireturnkeysearch,//blue button labeled Search
    9. Uireturnkeysend,//blue button labeled Send
    10. Uireturnkeyyahoo,//blue button labeled Yahoo! for searching
    11. Uireturnkeydone,//blue button labeled done
    12. Uireturnkeyemergencycall,//Emergency call button
    13. } Uireturnkeytype;

Usage Use cases:

Textview.returnkeytype=uireturnkeygo;

Four, automatic capitalization

    1. typedef enum {
    2. Uitextautocapitalizationtypenone, //not automatically capitalized
    3. Uitextautocapitalizationtypewords, //capitalize the first letter of the word
    4. Uitextautocapitalizationtypesentences, //capitalize the first letter of the sentence
    5. Uitextautocapitalizationtypeallcharacters, //all letters capitalized
    6. } Uitextautocapitalizationtype;

Usage Use cases:

Textfield.autocapitalizationtype = Uitextautocapitalizationtypewords;

Five, automatic correction

    1. typedef enum {
    2. Uitextautocorrectiontypedefault,//default
    3. Uitextautocorrectiontypeno,//not automatically corrected
    4. Uitextautocorrectiontypeyes,// AutoCorrect
    5. } Uitextautocorrectiontype;

Usage Use cases:

TextField. Autocorrectiontype = Uitextautocorrectiontypeyes;

Six, secure text input

Textview.securetextentry=yes;

Turning on secure input is primarily for passwords or some private data input, which disables AutoCorrect and self-caching.

Uitextfield and Uitextview hidden keyboards

Self._textfield.returnkeytype=uireturnkeydone;

self._textfield.delegate=self;

-(BOOL) Textfieldshouldreturn: (Uitextfield *) textfield{

[TextField Resignfirstresponder];

return YES;

}

self._textview.delegate=self;

Self._textview.returnkeytype=uireturnkeydone;

-(BOOL) TextView: (Uitextview *) TextView Shouldchangetextinrange: (nsrange) Range

Replacementtext: (NSString *) Text {

if ([text isequaltostring:@ "\ n"]) {

[TextView Resignfirstresponder];

return NO;

}

return YES;

}

iOS keyboard style/style

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.