【发布时间】:2022-01-10 03:44:13
【问题描述】:
在最新的 iOS 13 版本中获取导航栏和表格视图之间的空间?尝试了很多解决方案。没运气?请帮助我。 尝试以下解决方案
1.
scrollView.contentInsetAdjustmentBehavior = .automatic
2.
if #available(iOS 11.0, *) {
tblView.contentInsetAdjustmentBehavior = .never
} else {
automaticallyAdjustsScrollViewInsets = false
}
}
3.
overrideUserInterfaceStyle = .dark
4.
yourtableView.tableHeaderView?.removeFromSuperview()
yourtableView.tableHeaderView = UIView(frame: CGRect(x: 0, y: 0, width: 0, height: CGFloat.leastNonzeroMagnitude))
yourtableView.layoutIfNeeded()
【问题讨论】:
-
这个问题只出现在 iOS 13 上吗?你试过在 iOS 12 上模拟它吗?
标签: swift tableview navigationbar spacing ios13