Reputation: 259
Describe the bug
When I have multiple textfields on same scrollview, ScrollView will have mistake scrolling offset after I transpose to each textfield. (You can see on demo video)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Scrolling offset must scroll to correct position
Demo video
According Demo video you will see. First, I entered on input11
field and after that I select on input2
but scrollview is scrolling to input11
again. I have no Idea what I'm doing wrong because this is normal textfield in scrollview that doesn't have any code.
Xcode: 12.5
Mac OS: Big sur 11.4
Simulator/Device: IphoneXr 14.4.2
Simulator/Device Name: IphoneXr
Library Version: ~> 6.5.0
It look like it's happened on only iOS 14+, Can't fix by myself. So many official app have problem like me. wait for apple...
Upvotes: 2
Views: 1855
Reputation: 2613
I create a demo. The demo does not install the IQKeyboardManager, have my TableviewController which has an offset bug. UITableViewController works well in my demo. It is the Apple iOS System that controls the offset of UITableview when the keyboard will show.
In my opinion, maybe disabling the IQKeyboardManager will solve the problem.
I change enable like the code below. And I test in my project. The keyboard in my UITableViewContrller shows OK now.
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
IQKeyboardManager.shared().isEnabled = false
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
IQKeyboardManager.shared().isEnabled = true
}
Upvotes: 1