uitextfield键盘遮挡问题
来源:互联网 发布:淘宝能办理信用卡 编辑:程序博客网 时间:2024/04/29 04:19
转载自:http://hi.baidu.com/xuen2460697/item/17e04807bed6f2873d42e265
键盘遮挡无非是要上移view,然后还原.
//键盘出现时,view上移
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.3];
[UIView setAnimationDelegate:self];
self.view.frame = CGRectMake(0, -130, 320, 460);
//130就是上移的距离
[UIView commitAnimations];
//键盘消失后,view还原
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.3];
[UIView setAnimationDelegate:self];
self.view.frame = CGRectMake(0, 0, 320, 460);
//还原
[UIView commitAnimations];
//chenyong textfield委托方法,当按下Return时键盘收起
-(BOOL)textFieldShouldReturn:(UITextField *)textField{
[UIViewbeginAnimations:nilcontext:NULL];
[UIViewsetAnimationDuration:0.3];
[UIViewsetAnimationDelegate:self];
self.view.frame =CGRectMake(0, 0,320, 460);//还原
[UIViewcommitAnimations];
[textField resignFirstResponder];
return YES;
}
//-(BOOL)textFieldShouldEndEditing:(UITextField *)textField
-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
[UIViewbeginAnimations:nilcontext:NULL];
[UIViewsetAnimationDuration:0.3];
[UIViewsetAnimationDelegate:self];
self.view.frame =CGRectMake(0, -130,320, 460);//130就是上移的距离
[UIViewcommitAnimations];
return YES;
}
- uitextfield键盘遮挡问题
- 键盘遮挡问题(UITextField)
- UITextField被键盘遮挡问题
- 解决键盘遮挡UITextField问题
- ios键盘遮挡UITextField问题
- UI 03 关于UITextField键盘遮挡问题
- iOS UITextField,UITextView键盘遮挡问题
- UIScrollView中的UITextField键盘遮挡问题的最简单解决办法
- 解决键盘遮挡输入框(UITextField)问题
- IOS开发(21)关于UITextField的键盘遮挡问题
- UIScrollView中的UITextField键盘遮挡问题的最简单解决办法
- ios--解决键盘遮挡UITextField控件的问题(方式一)
- ios--解决键盘遮挡UITextField控件的问题(方式二)
- 解决键盘遮挡输入框(UITextField)问题
- 解决键盘遮挡输入框(UITextField)问题
- uitextfield 键盘遮挡时上移
- UITextField被弹出键盘遮挡
- 如何处理键盘遮挡UITextField
- mongodb学习
- linux下mysql集群搭建
- android上中断执行的Runnable
- Ubuntu下用codeblock+mysql安装、配置、连接
- PowerQUICC
- uitextfield键盘遮挡问题
- A. Dividing Orange
- Jquery介绍
- github上传代码
- JAVA 修改XML文件
- HTTP 状态代码
- 利用DataSet的ReadXml轻松读取XML文件及Stream流
- C# asp.net获取当前网址url
- win2008 多用户远程访问