码迷,mamicode.com
首页 > 其他好文 > 详细

UITextField控件

时间:2014-08-06 17:16:41      阅读:213      评论:0      收藏:0      [点我收藏+]

标签:style   color   ar   type   ad   ui   ef   text   

用处:输入控件

-(void)viewDidLoad

{

  [super viewDidLoad];

//设置大小

CGRect frame = CGRectMake(20,20,150,40);

//实例化UITextField

self.tf = [[UITextField alloc]initWithFrame:frame];

//提示信息(灰体)

self.tf.placeholder = @"type in password";

//边框样式

self.tf.borderStyle = UITextBorderStyleRoundedRect;

//对齐方式

self.tf.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;

self.tf.textAlignment = NSTextAlignmentLeft;

//密码

self.tf.secureTextEntry = YES;

//编辑时的清除按钮

self.tf.clearButtonMode = UITextFieldViewModeWhileEditing;

[self.view addSubView:self.tf];

}

UITextField控件,布布扣,bubuko.com

UITextField控件

标签:style   color   ar   type   ad   ui   ef   text   

原文地址:http://www.cnblogs.com/AngryCooder/p/3894653.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!