UIKeyboard鍵盤相關知識點-IOS開發
一、鍵盤風格
UIKit框架支援8種風格鍵盤。
- typedef enum {
- UIKeyboardTypeDefault, // 預設鍵盤:支援所有字元
- UIKeyboardTypeASCIICapable, // 支援ASCII的預設鍵盤
- UIKeyboardTypeNumbersAndPunctuation, // 標準電話鍵盤,支援+*#等符號
- UIKeyboardTypeURL, // URL鍵盤,有.com按鈕;只支援URL字元
- UIKeyboardTypeNumberPad, //數字鍵盤
- UIKeyboardTypePhonePad, // 電話鍵盤
- UIKeyboardTypeNamePhonePad, // 電話鍵盤,也支援輸入人名字
- UIKeyboardTypeEmailAddress, // 用於輸入電子郵件地址的鍵盤
- } UIKeyboardType;
用法用例:
textView.keyboardtype = UIKeyboardTypeNumberPad;
二、鍵盤外觀
- typedef enum {
- UIKeyboardAppearanceDefault, // 預設外觀:淺灰色
- UIKeyboardAppearanceAlert, //深灰/石墨色
- } UIKeyboardAppearance;
用法用例:
textView.keyboardAppearance=UIKeyboardAppearanceDefault;
三、Enter鍵
- typedef enum {
- UIReturnKeyDefault, //預設:灰色按鈕,標有Return
- UIReturnKeyGo, //標有Go的藍色按鈕
- UIReturnKeyGoogle, //標有Google的藍色按鈕,用於搜尋
- UIReturnKeyJoin, //標有Join的藍色按鈕
- UIReturnKeyNext, //標有Next的藍色按鈕
- UIReturnKeyRoute, //標有Route的藍色按鈕
- UIReturnKeySearch, //標有Search的藍色按鈕
- UIReturnKeySend, //標有Send的藍色按鈕
- UIReturnKeyYahoo, //標有Yahoo!的藍色按鈕,用於搜尋
- UIReturnKeyDone, //標有Done的藍色按鈕
- UIReturnKeyEmergencyCall, //緊急呼叫按鈕
- } UIReturnKeyType;
用法用例:
textView.returnKeyType=UIReturnKeyGo;
四、自動大寫
- typedef enum {
- UITextAutocapitalizationTypeNone, //不自動大寫
- UITextAutocapitalizationTypeWords, //單詞首字母大寫
- UITextAutocapitalizationTypeSentences, //句子首字母大寫
- UITextAutocapitalizationTypeAllCharacters, //所有字母大寫
- } UITextAutocapitalizationType;
textField.autocapitalizationType = UITextAutocapitalizationTypeWords;
五、自動更正
- typedef enum {
- UITextAutocorrectionTypeDefault,//預設
- UITextAutocorrectionTypeNo,//不自動更正
- UITextAutocorrectionTypeYes,//自動更正
- } UITextAutocorrectionType;
textField.autocorrectionType = UITextAutocorrectionTypeYes;
六、安全文字輸入
textView.secureTextEntry=YES;
開啟安全輸入主要是用於密碼或一些私人資料的輸入,此時會禁用自動更正和自此快取。
七、鍵盤遮住檢視
這個問題又來已久,我專門寫了篇文章來解決此問題,請笑納:《 開啟鍵盤遮住View的問題解決方法》
相關文章
- Android關於鍵盤相關知識Android
- 遊戲伺服器開發相關知識點遊戲伺服器
- 整理:iOS開發知識點iOS
- Git相關知識點Git
- redis相關知識點Redis
- shell相關知識點
- Oracle 相關知識點Oracle
- 【Java】容器相關知識點Java
- ivar layout 相關知識點
- LR模型相關知識點模型
- ARP相關知識點
- Java併發相關知識點梳理和研究Java
- React相關知識點:關於ReduxReactRedux
- iOS開發-鍵盤通知iOS
- Java容器相關知識點整理Java
- 總結 MySQL 相關知識點MySql
- JVM相關知識點總結JVM
- UIBarButtonItem的相關知識點UI
- library cache相關知識點
- Extjs相關知識點梳理JS
- tmpwatch相關的知識點
- 混合開發之phonegap開發相關知識解析
- ios蘋果企業賬號知識盤點iOS蘋果
- 面試系列之View相關知識點面試View
- 資料庫相關知識點提要資料庫
- oracle檢查點的相關知識Oracle
- GreatSQL統計資訊相關知識點SQL
- Android 藍芽開發相關知識總結Android藍芽
- iOS 知識點iOS
- 相親原始碼前端開發知識點,每天進步一點點原始碼前端
- Fragment 相關知識點都在這裡了Fragment
- PHP物件相關知識點的總結PHP物件
- rman配置及常用操作相關知識點
- 安卓日常開發記錄-鍵盤的相關處理方式安卓
- Shell相關知識
- .net相關知識
- mobile相關知識
- rollback相關知識