zoukankan      html  css  js  c++  java
  • 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);

            }];

        }

        

    }

  • 相关阅读:
    053-49
    053-3
    053-204
    053-491
    053-205
    053-57
    053-149
    053-47
    053-150
    回答2
  • 原文地址:https://www.cnblogs.com/daaiwusehng/p/4792905.html
Copyright © 2011-2022 走看看