IQKeyboardManager icon indicating copy to clipboard operation
IQKeyboardManager copied to clipboard

keyboard show but textfield not moved above the keyboard

Open JsonKit opened this issue 11 months ago • 3 comments

I discovered an issue involving the following code in Controller A:

Image

In Controller A, there is a TextField. After bringing up the keyboard to input text and then dismissing it, we navigate to Controller B.

Controller B also contains a TextField. However, when the keyboard is brought up in Controller B, the TextField cannot be pushed above the keyboard, making it impossible to input text.

The root cause is that in the keyboardWillShow method, _kbFrame and oldKBFrame are equal, which prevents adjustPosition from being executed.

Image

The reason why _kbFrame and oldKBFrame are equal is as follows:

keyboardWillShow

Image

keyboardWillHide, enable is false, so _kbFrame can not reset CGRectZero

Image

should the following two lines of code be placed before the check for enable? _kbFrame = CGRectZero; [self notifyKeyboardSize:_kbFrame.size];

JsonKit avatar May 22 '25 09:05 JsonKit

I have the same issue.

Korcia avatar May 28 '25 14:05 Korcia

I have solved the problem because I have realized that there were conflicting layout constraints in my UIView design.

Korcia avatar May 28 '25 15:05 Korcia

I believe you are using Objective-C version of the library. I would say that it hasn't been updated since long and I would suggest you to try out the Swift version of the library to check if the same issue still exist with Swift version of the library. If issue still persist then please share a demo project with me.

hackiftekhar avatar Jun 05 '25 13:06 hackiftekhar