1.

- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
} - (void)registerNotification {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showKeyboard:) name:UIKeyboardWillShowNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(hideKeyboard:) name:UIKeyboardWillHideNotification object:nil];
} #pragma mark - keyboard
- (void)showKeyboard:(NSNotification *)noti {
NSDictionary *info=[noti userInfo]; NSTimeInterval duration = [info[UIKeyboardAnimationDurationUserInfoKey] doubleValue];
UIViewAnimationOptions options = [info[UIKeyboardAnimationCurveUserInfoKey] unsignedIntegerValue] << ; CGRect keyboardRect = [info[UIKeyboardFrameEndUserInfoKey] CGRectValue];
CGFloat keyboardHeight = MIN(CGRectGetWidth(keyboardRect), CGRectGetHeight(keyboardRect)); [UIView animateWithDuration:duration delay: options:options animations:^{
CGFloat compareH = self.tableView.contentSize.height -(self.view.height - - - keyboardHeight);
if (compareH > ) {
if (compareH < keyboardHeight) {
self.tableView.transform = CGAffineTransformMakeTranslation(, -compareH);
} else {
self.tableView.transform = CGAffineTransformMakeTranslation(, -keyboardHeight);
}
} self.bottomView.transform = CGAffineTransformMakeTranslation(, -keyboardHeight); } completion:nil];
} - (void)hideKeyboard:(NSNotification *)noti { NSDictionary *info=[noti userInfo]; NSTimeInterval duration = [info[UIKeyboardAnimationDurationUserInfoKey] doubleValue];
UIViewAnimationOptions options = [info[UIKeyboardAnimationCurveUserInfoKey] unsignedIntegerValue] << ; [UIView animateWithDuration:duration delay: options:options animations:^{ self.tableView.transform = CGAffineTransformIdentity;
self.bottomView.transform = CGAffineTransformIdentity; } completion:nil]; }

第11月第31天 keyboardwillshow CGAffineTransformMakeTranslation的更多相关文章

  1. psp进度(11月25号-31号)

    本周psp进度 11月25号 内容 开始时间 结束时间 打断时间 净时间 处理数据集  9:27  11:34  12m  115m 11月27号 内容 开始时间 结束时间 打断时间 净时间  scr ...

  2. 「P4996」「洛谷11月月赛」 咕咕咕(数论

    题目描述 小 F 是一个能鸽善鹉的同学,他经常把事情拖到最后一天才去做,导致他的某些日子总是非常匆忙. 比如,时间回溯到了 2018 年 11 月 3 日.小 F 望着自己的任务清单: 看 iG 夺冠 ...

  3. .NET周报【11月第1期 2022-11-07】

    国内文章 开源·安全·赋能 - .NET Conf China 2022 https://mp.weixin.qq.com/s/_tYpfPeQgyEGsnR4vVLzHg .NET Conf Chi ...

  4. 本周psp(11月17-23)

    本周psp进度 11月19号 内容 开始时间 结束时间 打断时间 净时间 发布读书笔记 11:05 11:25 0 20m 看构建之法书 9:50 10:48 5m 53m 11月20号 内容 开始时 ...

  5. Autodesk 2013开发者日(DevDays)又要来了 -- 北京(2013年11月7日)和上海(2013年11月11日)

    各位, 一年一度的Autodesk 开发者日(Devdays)开始注册了,抓紧时间前排占座! 注册地址: www.autodesk.com.cn/adndevday2013 今年开发者日的主题:革命性 ...

  6. GTAC 2015将于11月10号和11号召开

    今年的GTAC注册已经结束,将会在11月10号和11号在Google马萨诸塞州剑桥办公室召开.大家可以关注https://developers.google.com/google-test-autom ...

  7. 2016年11月6日--form表单验证和事件、正则表达式

    1.表单验证<form></form> (1).非空验证(去空格) (2).对比验证(跟一个值对比) (3).范围验证(根据一个范围进行判断) (4).固定格式验证:电话号码, ...

  8. 11月30日《奥威Power-BI智能分析报表制作方法》腾讯课堂开课啦

    这么快一周就过去了,奥威公开课又要与大家见面咯,上节课老师教的三种报表集成方法你们都掌握了吗?大家都知道,学习的结果在于实际应用,想要熟练掌握新内容的要点就在于去应用它.正是基于这一要点,每一期的课程 ...

  9. 补psp进度(11月4号-9号)

    这周psp进度 11月4号 内容 开始时间 结束时间 打断时间 净时间 小伙伴聊天实现 9:45 10:49 0 64m 学习HttpURLConnection 14:13 15:48 10m 85m ...

随机推荐

  1. 微软职位内部推荐-SW Engineer II for WinCE

    微软近期Open的职位: Do you have a passion for embedded devices and services? &nbsp Does the following m ...

  2. ubuntu 下配置 开发环境

    1. apache: sudo apt-get install apache2 安装好输入网址测试所否成功: http://localhost 2. mongo 已经安装好了 版本:2.4.8 ref ...

  3. PAT甲题题解-1081. Rational Sum (20)-模拟分数计算

    模拟计算一些分数的和,结果以带分数的形式输出注意一些细节即可 #include <iostream> #include <cstdio> #include <algori ...

  4. 微信小程序动画技巧

    用微信小程序自带的wx.createAnimation api可创建动画,该动画效果相比css写的动画更流畅. 栗子与用法,见官网:https://mp.weixin.qq.com/debug/wxa ...

  5. Access restriction: The type 'BASE64Decoder' is not API

    Access restriction: The type 'BASE64Decoder' is not API (restriction on required library 'C:\Program ...

  6. node解决跨域问题

    app.all('*', function(req, res, next) { res.header("Access-Control-Allow-Origin", "*& ...

  7. [转帖]linux namespace 和cgroup lxc

    https://blog.csdn.net/xiaoliuliu2050/article/details/53443863 5.1 linux namespace 和cgroup lxc 2016年1 ...

  8. C#中几种创建对象的方式的对比

    最近学习了msil,发现了很多好玩的,今天介绍一个用IL来创建对象的方式 1.最常见的两种创建对象方式 public static T Create<T>() where T : new( ...

  9. spring not_support 该方法被事务方法调用时 不会加入spring事务 只是执行jdbc普通的事务

  10. java 栈和堆