作者:朱克锋
邮箱:zhukefeng@iboxpay.com
转载请注明出处:http://blog.csdn.net/linux_zkf
UITextField *tf;
初始化
tf = [[UITextField alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 100.0f, 30.0f)];
tf.center = CGPointMake(160.0f, 120.0f);
边框类型
tf.borderStyle = UITextBorderStyleRoundedRect;
自动纠错
tf.autocorrectionType = UITextAutocorrectionTypeNo;
预置字段
tf.placeholder = @"Name";
返回键类型
tf.returnKeyType = UIReturnKeyDone;
清楚小按钮(小的X)
tf.clearButtonMode = UITextFieldViewModeWhileEditing;
tf.delegate = self;
[self.view addSubview:tf];
[tf release];