First, the keyboard style
The Uikit Framework supports 8 styles of keyboards.
- typedef enum {
- Uikeyboardtypedefault, //default keyboard: All characters supported
- Uikeyboardtypeasciicapable, //ASCII-enabled default keyboard
- Uikeyboardtypenumbersandpunctuation, //Standard telephone keypad, supports +* #等符号
- Uikeyboardtypeurl, //URL keyboard with. com button; URL characters only
- Uikeyboardtypenumberpad, //numeric keypad
- Uikeyboardtypephonepad, //Telephone keypad
- Uikeyboardtypenamephonepad, //telephone keypad, also support input person name
- Uikeyboardtypeemailaddress, //keyboard for entering e-mail addresses
- } Uikeyboardtype;
Usage Use cases:
Textview.keyboardtype = Uikeyboardtypenumberpad;
Second, keyboard appearance
- typedef enum {
- Uikeyboardappearancedefault, //default appearance: Light grey
- Uikeyboardappearancealert, //dark grey/graphite
- } uikeyboardappearance;
Usage Use cases:
Textview.keyboardappearance=uikeyboardappearancedefault;
Third, enter
- typedef ENUM {
- Uireturnkeydefault,//default: Gray button, marked with return
- Uireturnkeygo,//blue button labeled Go
- Uireturnkeygoogle,//blue button labeled Google for search
- Uireturnkeyjoin,//blue button labeled Join
- Uireturnkeynext,//blue button labeled Next
- Uireturnkeyroute,//blue button labeled route
- Uireturnkeysearch,//blue button labeled Search
- Uireturnkeysend,//blue button labeled Send
- Uireturnkeyyahoo,//blue button labeled Yahoo! for searching
- Uireturnkeydone,//blue button labeled done
- Uireturnkeyemergencycall,//Emergency call button
- } Uireturnkeytype;
Usage Use cases:
Textview.returnkeytype=uireturnkeygo;
Four, automatic capitalization
- typedef enum {
- Uitextautocapitalizationtypenone, //not automatically capitalized
- Uitextautocapitalizationtypewords, //capitalize the first letter of the word
- Uitextautocapitalizationtypesentences, //capitalize the first letter of the sentence
- Uitextautocapitalizationtypeallcharacters, //all letters capitalized
- } Uitextautocapitalizationtype;
Usage Use cases:
Textfield.autocapitalizationtype = Uitextautocapitalizationtypewords;
Five, automatic correction
- typedef enum {
- Uitextautocorrectiontypedefault,//default
- Uitextautocorrectiontypeno,//not automatically corrected
- Uitextautocorrectiontypeyes,// AutoCorrect
- } 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