我一直在我的应用程序中使用 UITableViewController。它在 iOS 10.x.x 中运行良好,但我最近将我的 Xcode 和 iOS 升级到(Xcode 9 和 iOS 11)。然后我的应用程序有这个 UI 问题。它将在带有静态单元格的 UITableViewController 中的 UITableView 上方显示 20 点的差距。有人遇到同样的问题并找到了解决方案吗?
最佳答案
这是由于 iOS 11 中引入的新属性。请尝试以下操作:
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
} else {
automaticallyAdjustsScrollViewInsets = false
}
关于iOS 11 在带有静态单元格的 UITableViewController 中与 tableview 相比有 20 点差距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46376654/