1.背景颜色 field.backgoundColor = [UIColor redColor];

2.设置field文字 field.text = @"输入文字";

3.设置field的提示文字 field.placeholder = @"请输入用户名";

4.设置field开始编辑时清除提示内容 field.clearsOnBeginEditing = YES;  

5.设置field的文字大小 field.font = [UIFont systemFontOfSize:14];

6.设置文字颜色 field.textColor = [UIColor redColor];

7.设置文字对齐方式 field.textAlignment = NSTextAlignmentCenter;

8.输入密码安全输入 field.secureTextEntry = YES;

9.弹出键盘样式  field.keyBoardType = UIKeyBoardTypeAlphabet;

10.设置field的键盘外观样式 field.keyBoardAppearance = UIKeyBoardAppearanceDefault;

11.设置输入框的外观 field.borderStyle = UITextBorderStyleLine;

12.输入框后面的清除按钮:field.clearButtonMode = UITextFieldViewModeUnlessEditing;

13.弹出的键盘最后的return可改为其它的,next,search等  field.returnKeyType = UIReturnKeyNext;

14.自定义弹出视图: field.inputView

UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 200)];

view.backgroundColor = [UIColor grayColor];

field.inputView = view;

[view release];

15.弹出一个辅助视图:field.inputAccessoryView

UIView *supView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0,30)];

supView.backgroundColor = [UIColor darkGrayColor];

field.inputAccessoryView = supView;

最新文章

  1. 这些.NET开源项目你知道吗?.NET平台开源文档与报表处理组件集合(三)
  2. GO语言总结(5)——类型转换和类型断言
  3. Linux cat命令
  4. Pillow实现图片对比
  5. AFNetworking 3.0.4 的使用
  6. Git commit 常见用法
  7. javascript之纯数字验证
  8. Sqlserver_视图
  9. CodeForces 569A 第八次比赛 C题
  10. 使用 Nuget打包类库
  11. JQuery_图片未加载!
  12. 【开源】NodeJS仿WebApi路由
  13. wordpress数据表分析
  14. WebFrom 【母版页】
  15. sql server连接字符串与tcp/ip开启
  16. emergency monitoring和real-time ADDM
  17. MySQL知识小结
  18. netstat-ll-grep-nohup-df-supervisord
  19. Linux下手工卸载11.2 RAC(非MOS的deinstall方法)
  20. SQL描述(2)

热门文章

  1. PHP静态延迟绑定和普通静态效率简单对比
  2. 推荐几个在线PDF转化成Word网站
  3. java中使用数组和链表简单实现SJBMap
  4. ajax使用json
  5. linux配置更改yum源
  6. Super Jumping! Jumping! Jumping!杭电1087
  7. springmvc+maven
  8. hadoop操作
  9. C++类与static
  10. ccf cv讲座记录