简体   繁体   English

当键盘出现时,UITableView不会滚动

[英]UITableView does not scroll when keyboard appears

UITableView does not auto-scroll when a UITextField/UITextView becomes the first responder. 当UITextField / UITextView成为第一个响应者时,UITableView不会自动滚动。 It used to work just fine on iOS 9-11, but now it doesn't work anymore on iOS 12. 它曾经在iOS 9-11上运行得很好,但现在它在iOS 12上不再起作用了。
What should I set up or change in the tableView to fix the behavior? 我应该在tableView设置或更改什么来修复行为?

Reference GIF 参考GIF

在此输入图像描述

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
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM