//1.初始化
[IQKeyBoardManager installKeyboardManager];
//2.添加一个输入框 并让他不显示
textFiled = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
[self.view addSubview:textFiled];
//3.添加键盘上方输入框布局
__unsafe_unretained UITextField *tf = textFiled;
[textFiled addTextFiled:^(UITextField *mTextFiled) {
//点击输入框的回车之后 回调回来的内容
[[[iToast makeText:[NSString stringWithFormat:@"输入的内容:%@",mTextFiled.text]] setGravity:iToastGravityCenter] show];
[tf resignFirstResponder];
}];
//4.显示键盘
[textFiled becomeFirstResponder];
![img](http://git.oschina.net/gejw0623/TextFiledWithKeyBoard/blob/master/TextFiledWithKeyBoard/screen.jpg)
-
Notifications
You must be signed in to change notification settings - Fork 1
Robin-JW/TextFiledWithKeyBoard
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
IOS中的在键盘上方显示输入框 类似于做快速评论用
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published