IQKeyboardManager
IQKeyboardManager copied to clipboard
View does not move up for the first time when tapped on textview
Keyboard covers the view, the first time something is typed in text view. From second time everything works fine. To Reproduce Steps to reproduce the behavior:
- Tap on a textview
- keyboard shows up but the view does not moves up hence keyboard covers the view.
Expected behavior View should move up showing the text view after the keyboard is up.
Screenshots https://user-images.githubusercontent.com/68046022/135574316-510f9f36-e02a-4e2d-8c50-fc7db966a091.MP4
Demo Project keyboardIssue.zip
Versions
Xcode: 12.4 (12D4e) **Mac OS: 11.2.1 **Device: tested on iPhone 6s (reproducable on any iPhone device) **Library Version: IQKeyboardManagerSwift (6.5.6)
Happening to me as well. Waitin for the update to be live. Our users are facing this issue in our live app now.
Happening to me as well. Waitin for the update to be live. Our users are facing this issue in our live app now.
Till the new update is out, you can try this - IQKeyboardManager.Swift -> func textFieldViewDidBeginEditing
look for below comment and code -
//On textView toolbar didn't appear on first time, so forcing textView to reload it's inputViews. textView.reloadInputViews()
now just below above mentioned code add these two lines to remove the issue
textView.resignFirstResponder() textView.becomeFirstResponder()
@NalineeSingh01 have you done: import: IQKeyboardManagerSwift to the App Delegate and then you need to put IQKeyboardManager.shared.enable = true inside the didFinishLaunchingWithOptions method also in App Delegate
https://github.com/hackiftekhar/IQKeyboardManager Screenshot 2021-10-23 at 17.02.55.pdf
@Flexology Yes this was already done in AppDelegate.
I also encounter such problem, how does the building Lord solve this problem
I'll need to check the demo project to see if that fixes the problem or not.
The problem still exists, on iPhone SE 1gen is reproduced
In my case, I notice the keyboard will work fine if got some delay by long press or make a debug point when I running my project. So i put this code and it looks works.
Solution 1: //On textView toolbar didn't appear on first time, so forcing textView to reload it's inputViews.
textView.reloadInputViews()
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.05) { (self.textFieldView as? UITextView)?.reloadInputViews() }
Solution 2: In your own VC,
textView.delegate = self
func textViewDidBeginEditing(_ textView: UITextView) { DispatchQueue.main.async { textView.reloadInputViews() } }
I checked the demo project and it looks like it's no longer reproducible with the demo project and with the iPhone SE 1st generation as well.
Hi,This issue still exists in the latest version, iPhone 6s plus 14.7.1