iOS有幾種不同的鍵盤布局?
iOS已經更新到第9代了,鍵盤數量也增加到了11個,所以這個問題的答案也需要更新下啦。
和目前排名首位的答案相比的鍵盤類型變化:
- 新增了第1個Default鍵盤和第4個URL鍵盤
- 刪除了Alphabet鍵盤,替換為Default鍵盤
- UIKeyboardTypeDefault 常用於文本輸入
- UIKeyboardTypeASCIICapable常用於密碼輸入
- UIKeyboardTypeNumbersAndPunctuation主鍵盤顯示如上圖,次鍵盤顯示字母
- UIKeyboardTypeURL適用於網址輸入
- UIKeyboardTypeNumberPad只有數字的數字鍵盤
- UIKeyboardTypePhonePad
可用於撥號的數字鍵盤
- UIKeyboardTypeNamePhonePad主鍵盤顯示如上圖,次鍵盤顯示如下圖
- UIKeyboardTypeEmailAddress 適用於郵件地址輸入的鍵盤
- UIKeyboardTypeDecimalPad帶「點」的數字鍵盤,可用於帶有小數點的數字輸入
- UIKeyboardTypeTwitter
- UIKeyboardTypeWebSearch
適用於網頁搜索的鍵盤
1、英文鍵盤:
- UIKeyboardTypeAlphabet(Alphabet字母)
- UIKeyboardTypeASCIICapable
- UIKeyboardTypeDefault
這三個默認都顯示字母表。默認下面第一幅圖,點左下角切換到下面第二幅圖。
2、數字鍵盤- UIKeyboardTypeDecimalPad (Decimal十進位)
- UIKeyboardTypeEmailAddress
4、沒有符號的英文鍵盤
- UIKeyboardTypeNamePhonePad
這個類型默認顯示第一幅圖片,如果點擊123按鈕則會顯示第二副鍵盤。
5、沒有小數點的數字鍵盤- UIKeyboardTypeNumberPad
- UIKeyboardTypeNumbersAndPunctuation
默認顯示下面第一幅圖,切換顯示第二幅
7、帶符號的數字鍵盤
- UIKeyboardTypePhonePad
默認顯示下面第一幅圖,切換顯示第二幅
8、推特鍵盤- UIKeyboardTypeTwitter
默認顯示下面第一幅圖,切換顯示第二幅
內容來自:http://blog.csdn.net/sanpintian/article/details/7377806陶智同學分享還少了一個URL鍵盤:UIKeyboardTypeURL // 用於輸入URL的鍵盤,有.com按鈕
最近剛好在了解這方面的內容,在@蘇打肥的基礎上,補充IOS10中增加的兩中類型。
參考:UIKit | Apple Developer Documentation (裡面詳細列出了13種鍵盤型號,但都不附圖,找了半天沒找到合適的,問開發小哥找齊了,終於)
IOS10中新增的兩個為:
- UIKeyboardTypeASCIICapableNumberPad
適用於輸入ASCII編碼(有可能描述不準,請各位大大指正)
guideline原文: Specifies a number pad that outputs only ASCII digits.
- UIKeyboardTypeAlphabet
為了字母輸入特別優化的。
其餘11個分別為:
1. UIKeyboardTypeDefault
Specifies the default keyboard for the current input method.
2. UIKeyboardTypeASCIICapable
Specifies a keyboard that displays standard ASCII characters.
3.UIKeyboardTypeNumbersAndPunctuation
Specifies the numbers and punctuation keyboard.
4. UIKeyboardTypeURL
Specifies a keyboard optimized for URL entry. This keyboard type prominently features the period (「.」) and slash (「/」) characters and the 「.com」 string.
5. UIKeyboardTypeNumberPad
Specifies a numeric keypad designed for PIN entry. This keyboard type prominently features the numbers 0 through 9. This keyboard type does not support auto-capitalization.
6. UIKeyboardTypePhonePad
Specifies a keypad designed for entering telephone numbers. This keyboard type prominently features the numbers 0 through 9 and the 「*」 and 「#」 characters. This keyboard type does not support auto-capitalization.
7. UIKeyboardTypeNamePhonePad
Specifies a keypad designed for entering a person』s name or phone number. This keyboard type does not support auto-capitalization.
8. UIKeyboardTypeEmailAddress
Specifies a keyboard optimized for entering email addresses. This keyboard type prominently features the at (「@」), period (「.」) and space characters.
9. UIKeyboardTypeDecimalPad
Specifies a keyboard with numbers and a decimal point.
10.UIKeyboardTypeTwitter
Specifies a keyboard optimized for Twitter text entry, with easy access to the at (「@」) and hash (「#」) characters.
11.UIKeyboardTypeWebSearch
Specifies a keyboard optimized for web search terms and URL entry. This keyboard type prominently features the space and period (「.」) characters.
web端要怎麼調用呢
當中文輸入法的時候時候有沒有不帶符號的鍵盤
typedef enum : NSInteger {
UIKeyboardTypeDefault ,
UIKeyboardTypeASCIICapable ,
UIKeyboardTypeNumbersAndPunctuation ,
UIKeyboardTypeURL ,
UIKeyboardTypeNumberPad ,
UIKeyboardTypePhonePad ,
UIKeyboardTypeNamePhonePad ,
UIKeyboardTypeEmailAddress ,
UIKeyboardTypeDecimalPad ,
UIKeyboardTypeTwitter ,
UIKeyboardTypeWebSearch ,
UIKeyboardTypeAlphabet = UIKeyboardTypeASCIICapable
} UIKeyboardType;
推薦閱讀: