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
- Typedef Enum {
- Uireturnkeydefault,
// Default value: the gray button marked with return
- Uireturnkeygo, // the blue button marked with go
- Uireturnkeygoogle,
// The blue button marked with Google for search
- Uireturnkeyjoin,
// Blue button marked with join
- Uireturnkeynext,
// The blue button marked with "Next"
- Uireturnkeyroute,
// The blue button marked with route
- Uireturnkeysearch,
// The blue button marked with Search
- Uireturnkeysend,
// The blue button marked with "send"
- Uireturnkeyyahoo,
// Marked with Yahoo! To search
- Uireturnkeydone,
// The blue button marked with done
- Uireturnkeyemergencycall,
// Emergency call button
- } 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