TextView键盘输入 弹出指定高度 点击return收回虚拟键盘
来源:互联网 发布:淘宝店最高等级是什么 编辑:程序博客网 时间:2024/04/30 08:11
textField代理相关操作方法
//点击背景关键盘- (IBAction)BackGround:(id)sender{ [[[UIApplication sharedApplication] keyWindow] endEditing:YES];}#pragma mark textfield delegate- (BOOL)textFieldShouldReturn:(UITextField *)textField{ [[[UIApplication sharedApplication] keyWindow] endEditing:YES]; return YES;}//textField 弹到指定高度- (void)textFieldDidBeginEditing:(UITextField *)textField{ CGRect frame = textField.frame; int offset = frame.origin.y + 32 - (self.view.frame.size.height - 216.0)+frame.size.height +88;//键盘高度216 NSTimeInterval animationDuration = 0.30f; [UIView beginAnimations:@"ResizeForKeyBoard" context:nil]; [UIView setAnimationDuration:animationDuration]; float width = self.view.frame.size.width; float height = self.view.frame.size.height; if(offset > 0) { CGRect rect = CGRectMake(0.0f, -offset,width,height); self.view.frame = rect; } [UIView commitAnimations]; }- (void)textFieldDidEndEditing:(UITextField *)textField{ NSTimeInterval animationDuration = 0.30f; [UIView beginAnimations:@"ResizeForKeyboard" context:nil]; [UIView setAnimationDuration:animationDuration]; CGRect rect = CGRectMake(0.0f, 0.0f, self.view.frame.size.width, self.view.frame.size.height); self.view.frame = rect; [UIView commitAnimations]; [textField resignFirstResponder];}
0 0
- TextView键盘输入 弹出指定高度 点击return收回虚拟键盘
- 点击键盘的return键收回键盘
- iOS textView return实现键盘收回
- 根据虚拟键盘弹出和收回控制UITextfield位置
- iOS 收回虚拟键盘
- textView 点击return 键时 键盘下去
- 键盘右下角的return按钮的点击事件 & 点击屏幕收回键盘
- 点击键盘收回的事件
- 点击任意空白收回键盘
- iOS点击空白收回键盘
- iOS-自定义textView键盘收回按钮
- web网页input框设置,点击input框弹出键盘,再收回键盘,焦点框会随页面滚动
- textview点击弹出键盘的回车键,添加相应事件
- android-获取虚拟键盘的高度(让虚拟键盘顶部和弹出框底部贴着)
- ios 点击空白处 收回键盘
- iOS 点击空白处收回键盘
- swift开发-点击屏幕 收回键盘
- 键盘点击return
- 行程长度压缩算法
- js中使用正则表达式
- [Linux] shell read 命令参数 -p用法
- s:checkboxlist s:checkbox 初始值设置
- 【Java TCP/IP Socket】UDP Socket
- TextView键盘输入 弹出指定高度 点击return收回虚拟键盘
- SSL证书SOCKET登陆JAVA
- python 加载libpython2.6.so.1.0 报错
- exec eval source
- mysql表排重
- SPOJ 371 Boxes 最小费用流
- DVD标准参考网站
- 机器学习完整过程案例分布解析,python代码解析
- 无可用源||调试时源文件与模块生成时的文件不同||无法单步调试