UITextField 和 UIButton的基本属性和用法
来源:互联网 发布:mac电磁阀中国有限公司 编辑:程序博客网 时间:2024/05/22 12:13
UITextField
placeholder //占位字符
font= [UIFontsystemFontOfSize:20];// 字体
clearButtonMode//清除按钮显示
{
UITextFieldViewModeNever, //不显示
UITextFieldViewModeWhileEditing,//编辑时显示
UITextFieldViewModeUnlessEditing,//编辑时不显示
UITextFieldViewModeAlways//一直显示
}
keyboardType//键盘类型
{
UIKeyboardTypeDefault, //默认键盘
UIKeyboardTypeASCIICapable,
UIKeyboardTypeNumbersAndPunctuation,
UIKeyboardTypeURL,
UIKeyboardTypeNumberPad, //数字键盘
UIKeyboardTypePhonePad, //电话键盘
UIKeyboardTypeNamePhonePad,
UIKeyboardTypeEmailAddress,
}
borderStyle://边框类型
{
UITextBorderStyleNone,//没有边框
UITextBorderStyleLine,//黑线直角
UITextBorderStyleBezel,//细线
UITextBorderStyle
returnKeyType //右下角return键样式
{
UIReturnKeyDefault,
UIReturnKeyGo,
UIReturnKeyGoogle,
UIReturnKeyJoin,
UIReturnKeyNext,
UIReturnKeyRoute,
UIReturnKeySearch,
UIReturnKeySend,
UIReturnKeyYahoo,
UIReturnKeyDone,
UIReturnKeyGo,
UIReturnKeyGoogle,
UIReturnKeyJoin,
UIReturnKeyNext,
UIReturnKeyRoute,
UIReturnKeySearch,
UIReturnKeySend,
UIReturnKeyYahoo,
UIReturnKeyDone,
UIReturnKeyEmergencyCall,
}
- (BOOL)becomeFirstResponder;//成为第一响应者
- (BOOL)resignFirstResponder;// 取消第一响应者
- (BOOL)isFirstResponder;//是否为第一响应者
delegate //代理
clearsOnBeginEditing //再次编辑时清空输入框 (YES , NO);
secureTextEntry //是否以密码点显示
//点击右下角return的实现
- (BOOL)textFieldShouldReturn:(UITextField*)textField
UITextField
//创建一个button
//注意!类方法创建对象不用手动管理内存
UIButton *button = [UIButtonbuttonWithType:UIButtonTypeCustom];
button.frame= CGRectMake(100,100,36,36);
button.tag= 100;//标签
button.backgroundColor= [UIColorredColor];//颜色
[buttonsetTitle:@"按钮"forState:UIControlStateNormal];//添加标题
{
forState //状态
UIControlStateNormal //正常
UIControlStateHighlighted //高亮
UIControlStateSelected //选中
}
//给button加标题颜色(不同状态下)
[buttonsetTitleColor:[UIColorblueColor] forState:UIControlStateNormal];
[ button.layersetCornerRadius: 10]给button添加边框圆角
//给button添加实现
[buttonaddTarget:selfaction:@selector(buttonClick:)//方法名 forControlEvents:UIControlEventTouchUpInside];
//给button添加图片
setImage:<#(UIImage *)#> forState:<#(UIControlState)#>
0 0
- UITextField 和 UIButton的基本属性和用法
- UITextField和UIButton属性
- UITextField的属性和用法.
- UITextField 的属性和用法
- UITextField属性和用法
- UIButton的基本属性和方法
- 简述UITextField的属性和用法
- UIButton的基本用法和事件
- UIButton和UITextField
- UIButton和UITextfield
- UI - UITextField和UIButton
- UItextField 和 UIbutton
- IOS的UITextField,UIButton,UIWebView的一些属性介绍和IOS图片资源的使用技巧
- UI 03 UIButton 和 UITextField
- UILabel和UIButton的属性
- UIButton的基本属性
- UIButton的基本用法
- UIButton的基本用法
- muduo::FileUtil、LogFile分析
- uvalive 4728(旋转卡壳求凸包最长直径)
- jquery常用方法
- Fragment向Fragment传值(第三种)
- iOS 客户端进行 RSA 加密并在 PHP 服务端进行解密
- UITextField 和 UIButton的基本属性和用法
- 自定义事件
- [黑马程序员](第51天)今晚复习小结
- 移动端开发
- 命令行执行程序时int argc,char *argv[ ]的意义
- Ubuntu升级系统
- git小结
- html标签大全
- linux_c 网络开发日记(3)库函数访问文件