IOS 快速檢視系統鍵盤樣式
阿新 • • 發佈:2019-02-19
typedef NS_ENUM(NSInteger, UIKeyboardType) {
UIKeyboardTypeDefault, // Default type for the current input method.
UIKeyboardTypeASCIICapable, // Displays a keyboard which can enter ASCII characters
UIKeyboardTypeNumbersAndPunctuation, // Numbers and assorted punctuation.
UIKeyboardTypeURL , // A type optimized for URL entry (shows . / .com prominently).
UIKeyboardTypeNumberPad, // A number pad with locale-appropriate digits (0-9, ۰-۹, ०-९, etc.). Suitable for PIN entry.
UIKeyboardTypePhonePad, // A phone pad (1-9, *, 0, #, with letters under the numbers).
UIKeyboardTypeNamePhonePad , // A type optimized for entering a person's name or phone number.
UIKeyboardTypeEmailAddress, // A type optimized for multiple email address entry (shows space @ . prominently).
UIKeyboardTypeDecimalPad NS_ENUM_AVAILABLE_IOS(4_1), // A number pad with a decimal point.
UIKeyboardTypeTwitter NS_ENUM_AVAILABLE_IOS(5_0), // A type optimized for twitter text entry (easy access to @ #)
UIKeyboardTypeWebSearch NS_ENUM_AVAILABLE_IOS(7_0), // A default keyboard type with URL-oriented addition (shows space . prominently).
UIKeyboardTypeASCIICapableNumberPad NS_ENUM_AVAILABLE_IOS(10_0), // A number pad (0-9) that will always be ASCII digits.
UIKeyboardTypeAlphabet = UIKeyboardTypeASCIICapable, // Deprecated
};
- 新增了第1個Default鍵盤和第4個URL鍵盤
- 刪除了Alphabet鍵盤,替換為Default鍵盤
1、UIKeyboardTypeDefault
常用於文字輸入
2、UIKeyboardTypeASCIICapable
常用於密碼輸入
3、UIKeyboardTypeNumbersAndPunctuation
主鍵盤顯示如上圖,次鍵盤顯示字母
4、UIKeyboardTypeURL
適用於網址輸入
5、UIKeyboardTypeNumberPad
只有數字的數字鍵盤
6、UIKeyboardTypePhonePad
可用於撥號的數字鍵盤
7、UIKeyboardTypeNamePhonePad
主鍵盤顯示如上圖,次鍵盤顯示如下圖
8、UIKeyboardTypeEmailAddress
適用於郵件地址輸入的鍵盤
9、UIKeyboardTypeDecimalPad
帶“點”的數字鍵盤,可用於帶有小數點的數字輸入
10、UIKeyboardTypeTwitter
11、UIKeyboardTypeWebSearch
適用於網頁搜尋的鍵盤