UITableView does not scroll when keyboard appears

走远了吗. 提交于 2019-12-07 06:01:09

问题


UITableView does not auto-scroll when a UITextField/UITextView becomes the first responder. It used to work just fine on iOS 9-11, but now it doesn't work anymore on iOS 12.
What should I set up or change in the tableView to fix the behavior?

Reference GIF


回答1:


I found solution in the code, as you said. This part of code was blame:

if #available(iOS 11.0, *) {
    tableView.contentInsetAdjustmentBehavior = .never
} else {
    automaticallyAdjustsScrollViewInsets = false
}


来源:https://stackoverflow.com/questions/52736185/uitableview-does-not-scroll-when-keyboard-appears

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!