如何处理 键盘弹起中文英文高度问题
来源:互联网 发布:stc单片机论坛 编辑:程序博客网 时间:2024/05/29 18:48
@interface CommentViewController ()<UITextFieldDelegate,UIGestureRecognizerDelegate>{
CGRect normalRect; //默认高度
}
//监控键盘
[[NSNotificationCenterdefaultCenter]addObserver:selfselector:@selector(keyBegin:)name:UIKeyboardWillShowNotificationobject:nil ];
[[NSNotificationCenterdefaultCenter]addObserver:selfselector:@selector(keyEnd:)name:UIKeyboardWillHideNotificationobject:nil ];
#pragma mark textField Methods-
- (void)keyBegin:(NSNotification *) notif{
CGRect keyBoardRect = [[notif.userInfoobjectForKey:UIKeyboardFrameEndUserInfoKey]CGRectValue];
[UIViewanimateWithDuration:.3animations:^{
self.commentView.frame =CGRectMake(self.commentView.frame.origin.x,normalRect.origin.y- keyBoardRect.size.height,self.commentView.frame.size.width,self.commentView.frame.size.height);
}completion:^(BOOL finished) {
}];
}
- (void)keyEnd:(NSNotification *) notif{
[UIViewanimateWithDuration:.3animations:^{
self.commentView.frame =normalRect; //恢复默认高度
}completion:^(BOOL finished) {
}];
}
- 如何处理 键盘弹起中文英文高度问题
- UIView如何处理键盘弹起和消失事件
- ios 监听键盘弹起时间和高度
- 键盘弹起的高度利用键盘通知获得
- iOS5的键盘高度问题处理
- iOS5的键盘高度问题处理
- 如何阻止手机虚拟键盘弹起
- 键盘弹起布局上移的问题
- 如何将ios键盘返回由英文设置成中文
- Android控件编辑时键盘弹起与关闭处理
- 处理Android手机键盘弹起之后挡住页面元素。
- 当键盘弹起的时候,屏幕适配键盘高度的方法
- 当键盘弹起的时候,屏幕适配键盘高度的方法
- 文本框随键盘动态改变位置(获取键盘弹起高度)
- 关于键盘弹起不遮挡交互控件的问题
- swift3.0键盘弹起,遮挡输入框问题
- ios键盘弹起tableView的滑动区域问题
- 求小球弹起高度
- ZigBee学习之旅
- 校园招聘,你准备好了吗?
- list_entry详解
- SDWebImage使用——一个可管理远程图片加载的类库
- win8.1 update1使用初体验
- 如何处理 键盘弹起中文英文高度问题
- vim: p
- 天地图在基于OpenLayers的服务器端进行部署的方法
- 开发过程中遇到的问题纪要
- eeprom被误改写的问题
- 致应届毕业生:第一份工作教会我们的7件事
- Xcdoe—CocoaPods安装和使用教程
- Mac OS X 安装 FreeTDS
- 留学新西兰 魂牵梦绕传智播客的课堂