How to get keyboard size to resize UITextView and how to use UIKeyboardFrameEndUserInfoKey with Japanese keyboard?

前端 未结 1 643
太阳男子
太阳男子 2020-12-30 15:55

How to get a keyboard size to resize UITextView and how to use UIKeyboardFrameEndUserInfoKey with Japanese keyboard? The following code to resize <

1条回答
  •  一整个雨季
    2020-12-30 16:39

    The correct fragment of the code:

    CGRect newFrame = editSource.frame;
    CGRect keyboardFrame = [self.view convertRect:keyboardEndFrame toView:nil];
    keyboardFrame.size.height -= tabBarController.tabBar.frame.size.height;
    if (up) {
        editHeight = newFrame.size.height;
        newFrame.size.height -= keyboardFrame.size.height;
    } else {
        newFrame.size.height = editHeight;
    }
    editSource.frame = newFrame;
    

    WARNIGN!

    The method is obsolete. The correct answer is located here: How can I add support for Chinese keyboard with UITextView on iOS 7?

    0 讨论(0)
提交回复
热议问题