Uitextfield and keyboard

Source: Internet
Author: User
In the program often need to use input, not only Uitextfield, as long as the need to apply to the keyboard input needs to operate the keyboard. So I looked up a bit about the keyboard in the input operation.


Keyboard type:
1. Uikeyboardtypedefault default keyboard
2. uikeyboardtypeasciicapable display ASCII code worth the keyboard
3. Uikeyboardtypenumbersandpunctuation display numbers and punctuation keys
4. Uikeyboardtypeurl display with. /. com URLs are commonly used to sign keyboards
5. Uikeyboardtypenumberpad Display 0 to 9 numeric keypad does not support automatic capitalization
6. Uikeyboardtypephonepad display with 0 to 9 and "*", "#" keyboard does not support automatic capitalization
7. Uikeyboardtypenamephonepad display a support Enter a contact name or number the keyboard does not support automatic capitalization
8. uikeyboardtypeemailaddress Display a keyboard "@" that supports entering email address symbols
9. Uikeyboardtypedecimalpad display 0 to 9 and "." Have a keyboard
Uikeyboardtypealphabet Display a letter keyboard
uitextinputtraits Protocol ReferenceThis is used to assist the keyboard input protocol, the need to use the keyboard input where the need to implement this protocol. Uitextfield and Uitextview have implemented this protocol.


The protocol consists mainly of several properties that must be set when used.
(1) Autocapitalizationtype:
Determine which SHIFT key is automatically pressed
Uitextautocapitalizationtype:
1.UITextAutocapitalizationTypeNone do not capitalize any text automatically
2. Uitextautocapitalizationtypewords automatically capitalize the first letter of each word
3. uitextautocapitalizationtypesentences automatically capitalize each sentence with the first letter
4. Uitextautocapitalizationtypeallcharacters automatic capitalization of each letter
(2) Autocorrectiontype
Automatic correction prompt, you can automatically prompt the correct spelling of the word, and give the correct word candidates.
Uitextautocorrectiontype
1.UITextAutocorrectionTypeDefault automatically select the appropriate prompt to the current scripting system
2. Uitextautocorrectiontypeno does not use automatic error correction
3. Uitextautocorrectiontypeyes using automatic error correction tips

(3) enablesreturnkeyautomatically
BOOL type sets whether the keyboard returns a key when the text box has no input
(7) keyboardappearanceSet the keyboard display style,
1. Uikeyboardappearancedefault Default display style
2. Uikeyboardappearancealert display a suitable pop-up panel
(5) Returnkeytype
Set the Return key type
1. Uireturnkeydefault set keyboard default Return key is: "Return"
2. Uireturnkeygo Set keyboard default Return key is: "Go"
3. Uireturnkeygoogle Set keyboard default Return key is: "Google"
4. Uireturnkeyjoin set keyboard default Return key is: "Join"
5. Uireturnkeynext is set to "Next"
6. Uireturnkeyroute is set to "Route"
7. Uireturnkeysearch is set to "the"
8. Uireturnkeysend is set to "Send"
9. Uireturnkeyyahoo is set to "Yahoo"
Uireturnkeydone set to "done"

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.