UITextField 与 键盘
来源:互联网 发布:服装行业数据分析 编辑:程序博客网 时间:2024/06/05 09:51
程序中常常要用到 输入 ,不只是UITextField ,只要需要运用到键盘输入就需要操作键盘。所以查找了一下有关键盘在输入中得操作。
UITextAutocapitalization
1.UITextAutocapitalizationTypeNone 不要自动大写任何文本
UITextAutocorrectionType
1.UITextAutocorrectionTypeDefault 自动选择适当得提示给当前得脚本系统
(3)enablesReturnKeyAutomati
1. UIKeyboardAppearanceDefault 默认显示风格
键盘类型 :
1.UIKeyboardTypeDefault 默认键盘
2.UIKeyboardTypeASCIICapable 显示ASCII码值得键盘
3.UIKeyboardTypeNumbersAndPunctuation 显示数字和标点符号得键盘
4.UIKeyboardTypeURL 显示带有 . / .com URL常用得符号得键盘
5.UIKeyboardTypeNumberPad 显示0到9得数字键盘 不支持自动大写
6.UIKeyboardTypePhonePad 显示带有0到9和“*”,“#”得键盘 不支持自动大写
7.UIKeyboardTypeNamePhonePad 显示一个支持输入一个联系人名字或者号码得键盘 不支持自动大写
8.UIKeyboardTypeEmailAddress 显示一个支持输入Email地址符号得键盘 “@”
9.UIKeyboardTypeDecimalPad 显示0到9 和 “."得键盘
10.UIKeyboardTypeAlphabet 显示一个字母键盘
UITextInputTraits Protocol Reference
这个是用来辅助键盘输入得协议,在需要用到键盘输入得地方都需要实现这个协议。UITextField和UITextView已经实现了这个协议。协议主要包含几个属性,在使用时必须设定。
(1)autocapitalizationType:
确定哪一次shift键被自动按下
UITextAutocapitalizationType:
2.UITextAutocapitalizationTypeWords 自动大写每一个单词得首字母
3.UITextAutocapitalizationTypeSentences 自动大写每一句话得首字母
4.UITextAutocapitalizationTypeAllCharacters 自动大写每一个字母
(2)autocorrectionType
自动纠正提示功能,可以自动提示单词拼写是否正确,并且给出候选正确单词提示。
UITextAutocorrectionType
2.UITextAutocorrectionTypeNo 不使用自动纠错
3.UITextAutocorrectionTypeYes 使用自动纠错提示
(3)enablesReturnKeyAutomatically
BOOL类型 设定当文本框没有输入内容时键盘得返回键是否可用
(7)keyboardAppearance
设定键盘显示风格,
2. UIKeyboardAppearanceAlert 显示一个合适得弹出式面板
(5)returnKeyType
1. UIReturnKeyDefault 设定键盘默认返回键为:“return”
设定返回键类型
2. UIReturnKeyGo 设定键盘默认返回键为:“Go”
3.UIReturnKeyGoogle 设定键盘默认返回键为:“Google”
4.UIReturnKeyJoin 设定键盘默认返回键为:“Join”
5. UIReturnKeyNext 设定为 “Next”
6. UIReturnKeyRoute 设定为 “Route”
7.UIReturnKeySearch 设定为 “Research”
8.UIReturnKeySend 设定为 “Send”
9.UIReturnKeyYahoo 设定为 “Yahoo”
10.UIReturnKeyDone 设定为 “Done”
11.UIReturnKeyEmergencyCall 设定为 “EmergencyCall” “紧急电话”
(5)KeybordType
设定键盘类型
(6)secureTextEntry
设定输入文本是否要受到隐藏保护,默认为NO不保护,设定为YES,则文本输入后为密码风格得保护。
要控制键盘是否在输入后消失,我们需要用到 UITextFieldDelegate
我们这样写,就可以让键盘按下Return键时,让键盘消失。
-(BOOL)textFieldShouldReturn:(UITextField *)textField
{
}
0 0
- UITextField 与 键盘
- [转载]UITextField 与 键盘
- UITextField 与 键盘
- UITextField 与键盘相关
- UITextField 与 键盘
- UITextField与键盘的控制
- IOS之UITextField与键盘
- UITextField与键盘returnSearch关联
- UITextField 与键盘 基本设置
- UITextField常用属性与回收UITextfield的键盘
- UITextField与键盘——IOS
- UITextField 键盘
- UITextField 键盘
- UITextField 键盘
- 动态监听UITextField键盘的弹出与退出
- 不让键盘挡住UITextField
- UITextField 键盘处理
- 不让键盘挡住UITextField
- Android开发中的程序调试
- leetcode 40. Combination Sum II
- 4.4、Android Studio在命令行运行Gradle
- ubuntu下转ttf, otf为woff文件
- Hadoop集群环境搭建
- UITextField 与 键盘
- 常用正则表达式示例
- android studio 的 Error occurred during initialization of VM Could not reserve enough space fo 解决办法
- [LC 94 144 145]Binary Tree Traversal ( preorder, inorder,postorder)
- 数据结构复习——线性表的链式存储实现(单向链表)
- How to Submit an URB
- SQL语句汇总
- java-设计模式之桥模式
- Ubuntu apt-get命令