在使用IQKeyboardManagerSwif
t时候,发现如果textField
的父视图是ScrollView
的情况下,IQKeyboardManagerSwift
就会失去效果。经过查找资料找到了解决方法:
通常情况下,在父视图调用以下两个方法能解决:
self.tableView.shouldIgnoreScrollingAdjustment = true
self.tableView.shouldRestoreScrollViewContentOffset = true
方法来自IQKeyboardManagerSwift
中IQUIScrollView+Additions
这个类: