【方法】
//背景文字
@property(nonatomic,copy) NSString *placeholder;
//正文
@property(nonatomic,copy) NSString *text;
//设置文本框的边框风格,可以设置为圆角矩形边框风格,默认风格为None
@property(nonatomic) UITextBorderStyle borderStyle;
//背景图(如果是圆角风格,图片将会失效,否则会显示图片,风格失效)
@property(nonatomic,retain) UIImage *background;
//文字超过范围以后自动变小
@property(nonatomic) BOOL adjustsFontSizeToFitWidth;
//最小能到几号
@property(nonatomic) CGFloat minimumFontSize;
//水平对齐方式(参考label)
@property(nonatomic) NSTextAlignment textAlignment;
//垂直对齐方式(参考button)
@property(nonatomic) UIControlContentVerticalAlignment contentVerticalAlignment;
//激活输入状态时清空之前的内容
@property(nonatomic) BOOL clearsOnBeginEditing;
//清空按钮的出现模式
@property(nonatomic) UITextFieldViewMode clearButtonMode;
//安全输入模式(暗文加密)
@property(nonatomic,getter=isSecureTextEntry) BOOL secureTextEntry;
//键盘类型
@property(nonatomic) UIKeyboardType keyboardType;
//回车键类型
@property(nonatomic) UIReturnKeyType returnKeyType;
//左view及出现模式
@property(nonatomic,retain) UIView *leftView;
@property(nonatomic) UITextFieldViewMode leftViewMode;
//右view及出现模式
@property(nonatomic,retain) UIView *rightView;
@property(nonatomic) UITextFieldViewMode rightViewMode;
//这个属性默认就是键盘,如果设置某个view那么弹出来的就不是键盘,而是自己设置的view
@property (readwrite, retain) UIView *inputView;
//这个view是随着键盘一起弹出的view
@property (readwrite, retain) UIView *inputAccessoryView;
- (BOOL)becomeFirstResponder;//响应输入状态
- (BOOL)resignFirstResponder;//结束输入状态
UITextFieldDelegate 【代理方法】
//开始编辑
- (void)textFieldDidBeginEditing:(UITextField *)textField;
//结束编辑
- (void)textFieldDidEndEditing:(UITextField *)textField;
//回车时触发
- (BOOL)textFieldShouldReturn:(UITextField *)textField;
viewcontroller方法
//弹出一个新的viewController
- (void)presentViewController:(UIViewController *)viewControllerToPresent animated: (BOOL)flag completion:(void (^)(void))completion;
//销毁当前viewcontroller
- (void)dismissViewControllerAnimated: (BOOL)flag completion: (void (^)(void))completion;