键盘隐藏秀上的额外空间问题 [英] Extra space issue at Keyboard hide show
本文介绍了键盘隐藏秀上的额外空间问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
希望你一切都好!
我在一个项目中有一个使用过的IQKeyboardManager库,并且在一个屏幕中我遇到了一个问题,请参见图片.
I have a used IQKeyboardManager library in a project and I have one screen in which i faced one issue of extra space see in pic.
问题链接( https://www.dropbox.com/s/ttlpnuu0ikaf515/Screen%20Shot%202018-02-05%20at%205.47.54%20PM.png?dl=0 )>
推荐答案
if #available(iOS 11.0, *) {
self.webView.scrollView.contentInsetAdjustmentBehavior = .never
} else {
self.automaticallyAdjustsScrollViewInsets = false
}
和UIScrollViewDelegate
And UIScrollViewDelegate
func scrollViewDidChangeAdjustedContentInset(_ scrollView: UIScrollView) {
Logger.print("scrollViewDidChangeAdjustedContentInset")
if #available(iOS 12.0, *) {
for view in webView.subviews {
if let scrollView = view as? UIScrollView {
scrollView.setContentOffset(.zero, animated: true)
}
}
}
}
工作
这篇关于键盘隐藏秀上的额外空间问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文