监听键盘 防止输入时覆盖掉textfiled
2015-12-18 14:40
225 查看
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardwasChange:) name:UIKeyboardWillChangeFrameNotification object:nil];
- (void)keyboardwasChange:(NSNotification *)info
{
CGRect keyFrame = [info.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
CGFloat tY = keyFrame.origin.y - self.view.frame.size.height - 64;
self.view.transform = CGAffineTransformMakeTranslation(0, tY);
}
- (void)keyboardwasChange:(NSNotification *)info
{
CGRect keyFrame = [info.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
CGFloat tY = keyFrame.origin.y - self.view.frame.size.height - 64;
self.view.transform = CGAffineTransformMakeTranslation(0, tY);
}
相关文章推荐
- rebot的使用
- python代码追踪
- java 中转换html 实体编码为汉字---unicode编码(\u)、十进制(&#)、十六进制(&#x)
- 部署SCCM2012之先决条件准备
- hdu-1977 Consecutive sum II
- Android Service学习之IntentService 深入分析
- 消息推送的那些坑
- Android onActivityResult获取返回值的用法
- 细谈会话管理-----Cookie和Session
- python通过pyserial读写串口--2013-06-02
- hdu-1976 Software Version
- LeetCode H-index and H-index II
- 利用VBA将excel数据表生成JSON文件(utf8)
- Mysql C API部分函数讲解
- Azure PowerShell 1.0.0以上版本在中国Azure使用的注意事项
- Azure PowerShell 1.0.0以上版本在中国Azure使用的注意事项
- Azure PowerShell 1.0.0以上版本在中国Azure使用的注意事项
- Azure PowerShell 1.0.0以上版本在中国Azure使用的注意事项
- LISP (Locator Identity Separation)协议详解(一)
- Leetcode202: Maximum Product of Word Lengths