[英]iOS 11 20 points gap over tableview in UITableViewController with static cells
I have been using a UITableViewController in my app. 我一直在我的应用程序中使用UITableViewController。 It worked fine in iOS 10.xx but I recently upgraded my Xcode and iOS to (Xcode 9 and iOS 11).
在iOS 10.xx上运行正常,但最近我将Xcode和iOS升级到了(Xcode 9和iOS 11)。 Then the my app is having this UI issue.
然后我的应用出现此UI问题。 It will show a 20 points gap above the UITableView in a UITableViewController with static cells.
在带有静态单元格的UITableViewController中,它将在UITableView上方显示20点的差距。 Anyone having same problem and found the solution for this?
任何有相同问题的人都找到了解决方案?
It is due to the new property introduced in iOS 11. Try the following: 这是由于iOS 11中引入了新属性。请尝试以下操作:
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
} else {
automaticallyAdjustsScrollViewInsets = false
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.