首页 > 移动平台 > 详细

iOS8 UIKeyboardWillShowNotification 键盘遮挡问题

时间:2015-09-30 16:03:54      阅读:1074      评论:0      收藏:0      [点我收藏+]

iOS8中,键盘呼出会发送UIKeyboardWillShowNotification两次通知,导致在做键盘遮挡问题的时候会减两遍键盘的高度,原因如下:

The reason is the difference in the keyboard. If the second field is a password field this means there is another keyboard under the hood. Therefore the notification is sent twice.

解决方法:

@property(nonatomic, assign) BOOL kbIsOn;

/*

* 注册键盘的通知addObserver

*/

-(void)keyboardWillShow:(NSNotification *)noti

{

  if(!_kbIsOn)

  {

    //遮挡操作  

  }

  _kbIsON = YES;

}

 

-(void)keyboardWillHidden

{

  _kbIsOn = NO;

  //复原操作

}

iOS8 UIKeyboardWillShowNotification 键盘遮挡问题

原文:http://www.cnblogs.com/vickjo/p/4849192.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!