首页 / IOS / iOS-键盘弹出的类型
iOS-键盘弹出的类型
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了iOS-键盘弹出的类型,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1845字,纯文字阅读大概需要3分钟。
内容图文
![iOS-键盘弹出的类型](/upload/InfoBanner/zyjiaocheng/1326/0671e4dbca3e4bec83eac320e08e2fdb.jpg)
iOS 提供了10种键盘类型,在开发中,我们可以根据不同的需求,选择不同的键盘样式,例如,当我们只需要输入手机号码时,可以选择纯数字类型的键盘(NumbersAndPunctuation),当我们需要输入网址时,可以选择URL样式的键盘(UIKeyboardTypeURL),其中,默认的键盘样式(UIKeyboardTypeDefault)就是(UIKeyboardTypeNamePhonePad)样式。
我们可以通过输入框的 keyboardType 来设置键盘样式
UITextField.keyboardType = UIKeyboardTypeNamePhonePad;
1、 UIKeyboardTypeDefault,
// Defaulttypefor the current input method.
2、 UIKeyboardTypeASCIICapable,
// Displays a keyboard which can enter ASCII characters, non-ASCII keyboards remain active
3、 UIKeyboardTypeNumbersAndPunctuation,
// Numbers and assorted punctuation.
4、 UIKeyboardTypeURL,
// A type optimized for URL entry (shows . / .com prominently).
5、 UIKeyboardTypeNumberPad,
// A number pad (0-9). Suitable for PIN entry.
6、 UIKeyboardTypePhonePad,
// A phone pad (1-9, *, 0, #, with letters under the numbers).
7、 UIKeyboardTypeNamePhonePad,
// A type optimized for entering a person‘s name or phone number.
8、 UIKeyboardTypeEmailAddress,
// A type optimized for multiple email address entry (shows space @ . prominently).
9、 UIKeyboardTypeDecimalPad NS_ENUM_AVAILABLE_IOS(4_1),
// A number pad with a decimal point.
10、 UIKeyboardTypeTwitter NS_ENUM_AVAILABLE_IOS(5_0),
// A type optimized for twitter text entry (easy accessto @ #)
11、 UIKeyboardTypeWebSearch NS_ENUM_AVAILABLE_IOS(7_0),
// A default keyboard typewith URL-oriented addition (shows space . prominently).
下面一图像展示区别
UIKeyboardTypeDefault
UIKeyboardTypeNumbersAndPunctuation
UIKeyboardTypeURL
UIKeyboardTypeNumberPad
UIKeyboardTypePhonePad
UIKeyboardTypeEmailAddress
UIKeyboardTypeDecimalPad
UIKeyboardTypeTwitter
UIKeyboardTypeWebSearch
原文:http://blog.csdn.net/mazy_ma/article/details/51333303
内容总结
以上是互联网集市为您收集整理的iOS-键盘弹出的类型全部内容,希望文章能够帮你解决iOS-键盘弹出的类型所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。