iOS第三方键盘高度获取不准确问题

直接上代码,搜狗的输入法

- (void)keyboardWasShown:(NSNotification*)aNotification

{

    //一旦键盘遮挡了输入框,那么就抬起来

    NSDictionary* info = [aNotification userInfo];

    CGSize kbSize = [[info objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue].size;

    

    if (CGRectGetMaxY(self.textFieldDelegate.superview.superview.frame)>(self.view.height - kbSize.height)) {

        [UIView animateWithDuration:0.5 animations:^{

            CGFloat h = CGRectGetMaxY(self.textFieldDelegate.superview.superview.frame) - (self.view.height - kbSize.height);

            self.view.transform = CGAffineTransformMakeTranslation(0, -h-5);

        }];

    }

 

    

}

 

文章来自:http://www.cnblogs.com/daaiwusehng/p/4792905.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3