IOS键盘的相关设置(UITextfield)
2016-04-27 11:34
741 查看
http://my.oschina.net/anyson/blog/106073
一、键盘风格
UIKit框架支持8种风格键盘。
typedef enum {
} UIKeyboardType;
用法用例:
textView.keyboardtype= UIKeyboardTypeNumberPad;
二、键盘外观
typedef enum {
} UIKeyboardAppearance;
用法用例:
textView.keyboardAppearance=UIKeyboardAppearanceDefault;
三、回车键
typedef enum {
} UIReturnKeyType;
用法用例:
textView.returnKeyType=UIReturnKeyGo;
四、自动大写
typedef enum {
} UITextAutocapitalizationType;
用法用例:
textField.autocapitalizationType = UITextAutocapitalizationTypeWords;
五、自动更正
typedef enum {
} UITextAutocorrectionType;
用法用例:
textField.autocorrectionType = UITextAutocorrectionTypeYes;
六、安全文本输入
textView.secureTextEntry=YES;
开启安全输入主要是用于密码或一些私人数据的输入,此时会禁用自动更正和自此缓存。
一、键盘风格
UIKit框架支持8种风格键盘。
typedef enum {
UIKeyboardTypeDefault, // 默认键盘:支持所有字符 UIKeyboardTypeASCIICapable, // 支持ASCII的默认键盘 UIKeyboardTypeNumbersAndPunctuation, // 标准电话键盘,支持+*#等符号 UIKeyboardTypeURL, // URL键盘,有.com按钮;只支持URL字符 UIKeyboardTypeNumberPad, //数字键盘 UIKeyboardTypePhonePad, // 电话键盘 UIKeyboardTypeNamePhonePad, // 电话键盘,也支持输入人名字 UIKeyboardTypeEmailAddress, // 用于输入电子邮件地址的键盘
} UIKeyboardType;
用法用例:
textView.keyboardtype= UIKeyboardTypeNumberPad;
二、键盘外观
typedef enum {
UIKeyboardAppearanceDefault, // 默认外观:浅灰色 UIKeyboardAppearanceAlert, //深灰/石墨色
} UIKeyboardAppearance;
用法用例:
textView.keyboardAppearance=UIKeyboardAppearanceDefault;
三、回车键
typedef enum {
UIReturnKeyDefault, //默认:灰色按钮,标有Return UIReturnKeyGo, //标有Go的蓝色按钮 UIReturnKeyGoogle, //标有Google的蓝色按钮,用于搜索 UIReturnKeyJoin, //标有Join的蓝色按钮 UIReturnKeyNext, //标有Next的蓝色按钮 UIReturnKeyRoute, //标有Route的蓝色按钮 UIReturnKeySearch, //标有Search的蓝色按钮 UIReturnKeySend, //标有Send的蓝色按钮 UIReturnKeyYahoo, //标有Yahoo!的蓝色按钮,用于搜索 UIReturnKeyDone, //标有Done的蓝色按钮 UIReturnKeyEmergencyCall, //紧急呼叫按钮
} UIReturnKeyType;
用法用例:
textView.returnKeyType=UIReturnKeyGo;
四、自动大写
typedef enum {
UITextAutocapitalizationTypeNone, //不自动大写 UITextAutocapitalizationTypeWords, //单词首字母大写 UITextAutocapitalizationTypeSentences, //句子首字母大写 UITextAutocapitalizationTypeAllCharacters, //所有字母大写
} UITextAutocapitalizationType;
用法用例:
textField.autocapitalizationType = UITextAutocapitalizationTypeWords;
五、自动更正
typedef enum {
UITextAutocorrectionTypeDefault,//默认 UITextAutocorrectionTypeNo,//不自动更正 UITextAutocorrectionTypeYes,//自动更正
} UITextAutocorrectionType;
用法用例:
textField.autocorrectionType = UITextAutocorrectionTypeYes;
六、安全文本输入
textView.secureTextEntry=YES;
开启安全输入主要是用于密码或一些私人数据的输入,此时会禁用自动更正和自此缓存。
相关文章推荐
- mysql获取自动生成的主键报错:Generated keys not requested. You need to specify Statement.RETURN_GENERATED_KEYS to Statement.execu
- UIButton 扩大按钮的响应区域
- easyui表格复选框的全选键是否选中
- 关于UITextView上部出现空白一步解决
- NSOperation和NSOperationQueue
- EF的SqlQuery和EntitySql
- iOS UILabel显示HTML文本
- Incredibuild 中出现Command line error D8037的解决方法
- !!!求教,java进行数据库查询,re.next()为true,但不执行if(re.next())分支
- Android view中的requestLayout和invalidate方法
- POJ2533 Longest Ordered Subsequence
- exception finished with non zero exit value 2
- 5_6 团体队列(UVa540)<queue与STL其他容器的综合运用>
- easyui和highcharts 动态加载数据和X轴数据
- LeetCode *** 307. Range Sum Query - Mutable (Binary Indexed Trees)
- 华工校赛 F. Bracket Sequence
- hdu1159Common Subsequence(动态规划之最长公共子序列)
- UI组件
- setAccessible(true)
- ThreadPoolExecutor使用和思考(上)-线程池大小设置与BlockingQueue的三种实现区别