首页 > 其他 > 详细

UITextField控件

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

用处:输入控件

-(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控件

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!