八:监听键盘的改变
//监听键盘
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(kbFrmWillChange:) name:UIKeyboardWillChangeFrameNotificationobject:nil];
}
-(void)kbFrmWillChange:(NSNotification *)noti{
NSLog(@"%@",noti.userInfo);
//获取窗口的高度
CGFloat windowH =[UIScreen mainScreen].bounds.size.height;
//键盘结束的Frm
CGRect kbEndFrm =[noti.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
//获取键盘结束的y值
CGFloat kbEndY =kbEndFrm.origin.y;
self.inputViewConstraint.constant = windowH -kbEndY;
}
文/牵左手不离(简书作者)
原文链接:http://www.easck.com/p/6b64d8ac62e3
著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”。
以上就是IOS开发网络篇—Socket编程的资料整理,后续继续补充相关资料,谢谢大家对本站的支持!
注:相关教程知识阅读请移步到IOS开发频道。










