search

Home  >  Q&A  >  body text

ios - 搜狗输入法键盘高度获取问题

使用(void)keyboardWillShow:(NSNotification *)aNotification获取搜狗输入法的信息时,得到的信息如下,键盘的高度为0.

{
    UIKeyboardAnimationCurveUserInfoKey = 7;
    UIKeyboardAnimationDurationUserInfoKey = "0.25";
    UIKeyboardBoundsUserInfoKey = "NSRect: {{0, 0}, {320, 0}}";
    UIKeyboardCenterBeginUserInfoKey = "NSPoint: {160, 568}";
    UIKeyboardCenterEndUserInfoKey = "NSPoint: {160, 568}";
    UIKeyboardFrameBeginUserInfoKey = "NSRect: {{0, 568}, {320, 0}}";
    UIKeyboardFrameEndUserInfoKey = "NSRect: {{0, 568}, {320, 0}}";
}

在键盘消失的方法(void)keyboardWillHide:(NSNotification *)aNotification
却能获取键盘的高度。

求问大神,这个问题怎么解决?

ringa_leeringa_lee2771 days ago593

reply all(3)I'll reply

  • PHP中文网

    PHP中文网2017-04-17 13:43:42

    No problem, he will call this notification multiple times. The correct height will be obtained later

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 13:43:42

    Try didShow. After all, it hasn’t been shown yet.

    reply
    0
  • 阿神

    阿神2017-04-17 13:43:42

    I also encountered this situation, did you solve it?

    reply
    0
  • Cancelreply