UITextField
来源:互联网 发布:软件项目个人总结 编辑:程序博客网 时间:2024/06/16 11:23
1、创建
UITextField *textField = [[UITextField alloc] init];
2、位置和大小
textField.frame = CGRectMake(100, 100, 200, 30);
3、背景颜色
textField.backgroundColor = [UIColor yellowColor];
4、提示语
textField.placeholder = @"这是提示词";
5、是否能编辑
textField.enabled = NO;
6、外形:倒角等
textField.layer.cornerRadius = 10;textField.layer.borderWidth = 1.5;textField.layer.borderColor = [[UIColor redColor] CGColor]; ``` 7、键盘类型
/*
UIKeyboardTypeDefault
UIKeyboardTypeASCIICapable
UIKeyboardTypeNumbersAndPunctuation
UIKeyboardTypeURL
UIKeyboardTypeNumberPad
UIKeyboardTypePhonePad
UIKeyboardTypeNamePhonePad
UIKeyboardTypeEmailAddress
UIKeyboardTypeDecimalPad
UIKeyboardTypeTwitter
UIKeyboardTypeWebSearch
UIKeyboardTypeAlphabet = UIKeyboardTypeASCIICapable
*/
textField.keyboardType = UIKeyboardTypePhonePad;
8、清除内容
/*
UITextFieldViewModeNever,
UITextFieldViewModeWhileEditing,
UITextFieldViewModeUnlessEditing,
UITextFieldViewModeAlways
*/
textField.clearButtonMode = UITextFieldViewModeAlways;
“`
0 0
- UITextField
- UITextField
- UITextField
- UITextField
- UITextField
- UITextField
- UITextField
- UITextField
- UITextField
- UITextField
- UITextField
- UITextField
- UITextField
- UITextField
- UITextField
- UITextField
- UITextField
- UITextField
- 常见监控工具说明
- Java数组定义
- 2.3、C++变量
- debug 宏追加打印的小例子
- [leetcode] Repeated DNA sequence
- UITextField
- 如何把shap文件转成sql
- 自己玩的时候千万别晕
- 2.4、C++常变量
- Storyboard(一)概述
- 柠檬BUG管理-最简单的在线BUG管理工具
- WebSocket 实战
- Mac下使用ssh、scp
- 防止网页打开超时设置