UITextFIEld *textFIEld = [[UITextFIEld alloc] initWithFrame:frame];textFIEld.keyboardType = UIKeyboardTypeDecimalPad;
根据文档,这是一个有效的键盘类型,但是当我编辑文本字段时,会出现正常的ASCII键盘.但是,当我将其更改为:
textFIEld.keyboardType = UIKeyboardTypePhonePad;
键盘看起来像这样:
理想情况下,我想要一个只有数字和小数点的键盘但这在iPad上是不可能的?有没有人有一个明确的列表,其中哪些键盘适用于iPhone和iPad?苹果目前还不清楚这一点.我也看到了这个类似的question,但没有一个答案能真正解决我的观点.
解决方法 这些是可以在两个iOS设备上使用的UIKeyboardTypes.从 the docs开始:Use the default keyboard for the current input method. Available in iOS 2.0 and later. Declared in
UIKeyboardTypeDefault
UITextinputTraits.h
.Use a keyboard that displays standard ASCII characters. Available in iOS 2.0 and later. Declared in
UIKeyboardTypeASCIICapable
UITextinputTraits.h
.Use the numbers and punctuation keyboard. Available in iOS 2.0 and later. Declared in
UIKeyboardTypeNumbersAndPunctuation
UITextinputTraits.h
.Use a keyboard optimized for URL entry. This type features “.”,“/”,and “.com” prominently. Available in iOS 2.0 and later. Declared in
UIKeyboardTypeURL
UITextinputTraits.h
.Use a numeric keypad designed for PIN entry. This type features the numbers 0 through 9 prominently. This keyboard type does not
UIKeyboardTypeNumberPad
support auto-cAPItalization. Available in iOS 2.0 and later. Declared inUITextinputTraits.h
.Use a keypad designed for entering telephone numbers. This type features the numbers 0 through 9 and the “*” and “#” characters
UIKeyboardTypePhonePad
prominently. This keyboard type does not support auto-cAPItalization. Available in iOS 2.0 and later. Declared inUITextinputTraits.h
.Use a keypad designed for entering a person’s name or phone number. This keyboard type does not support auto-cAPItalization. Available in iOS 2.0 and later. Declared in
UIKeyboardTypenamePhonePad
UITextinputTraits.h
.Use a keyboard optimized for specifying email addresses. This type features the “@”,“.” and space characters prominently. Available in iOS 2.0 and later. Declared in
UIKeyboardTypeEmailAddress
UITextinputTraits.h
.Use a keyboard with numbers and a decimal point. Available in iOS 4.1 and later. Declared in
UIKeyboardTypeDecimalPad
UITextinputTraits.h
.Use a keyboard optimized for twitter text entry,with easy access to the @ and # characters. Available in iOS 5.0 and later. Declared in
UIKeyboardTypeTwitter
UITextinputTraits.h
.Deprecated. Use UIKeyboardTypeASCIICapable instead. Available in iOS 2.0 and later. Declared in
UIKeyboardTypeAlphabet
UITextinputTraits.h
.
这是一些screenshots of the different types of keyboards.
总结以上是内存溢出为你收集整理的ios – 我可以在iPad上使用哪种UIKeyboardType全部内容,希望文章能够帮你解决ios – 我可以在iPad上使用哪种UIKeyboardType所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)