Closed MoLice closed 3 years ago
bug 原因在于 viewWillDisappear: 里先禁用键盘监听再降下键盘,导致 hide 时无法在 keyboardWillChangeFrame 里清空 keyboardHeight。 现改为 viewWillDisappear: 时不要禁用键盘,而是使用一个标志位屏蔽 updateLayout,使得 keyboardWillChangeFrame 可以正常触发,keyboardHeight 可以正常清零,只是 updateLayout 不会执行而已。
Bug 表现 一个复用的 QMUIModalPresentationViewController 在第一次 show 时升起键盘,内部的 keyboardHeight 变量会记录键盘的高度,当 hide 时 keyboardHeight 没有正确重置为 0,导致下一次 show 时就算没有升起键盘,也依然认为当前存在键盘。
截图
如何重现 伪代码如下:
预期的表现 hide 时正确清空 keyboardHeight
其他信息