在做键盘弹出跟隐藏时候的bug
1.在嵌套Scrollerview的情况下 touchBeagen事件不能触发
- 解决方法 自定义一个UIScrollerview 进行对touch事件的从写
class DictContentScrollView: UIScrollView {
open override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
self.next?.touchesBegan(touches, with: event)
super.touchesBegan(touches, with: event)
}
open override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?) {
self.next?.touchesMoved(touches, with: event)
super.touchesMoved(touches, with: event)
}
open override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
self.next?.touchesEnded(touches, with: event)
super.touchesEnded(touches, with: event)
}
}
2.在键盘弹出之后 在返回控制器时候不能响应进行隐藏键盘的bug
override func willMove(toParent parent: UIViewController?) {
noteKeyBoardView.submit()
}
网友评论