使用斯威夫特3和Xcode 9我使用的是大UINavigationBar
鉴于:iOS11如何同步大导航栏崩溃与滚动
if #available(iOS 11.0, *) {
navigationBar?.prefersLargeTitles = true
UINavigationBar.appearance().largeTitleTextAttributes = [
NSForegroundColorAttributeName: Colors.black
]
}
当我滚动UITableView
,酒吧崩溃得太快,其创建多余的空格:
前:
后:
当我触摸UITableView
酒吧崩溃。
的的tableView具有以下属性:
let rect = CGRect(
x: 0,
y: UIApplication.shared.statusBarView?.frame.height ?? 20,
width: UIScreen.main.bounds.width,
height: UIScreen.main.bounds.height
)
let tableView = UITableView(frame: rect)
的tableView
的顶部边界是self.navigationController?.navigationBar.frame.height ?? 44
另外,tableView
设置为:
if #available(iOS 11.0, *) {
self.contentInsetAdjustmentBehavior = .never
}
酒吧是半透明的,并且我希望保持这一点。我错过了什么?非常感谢帮助。
尝试在viewDidLoad self.automaticallyAdjustsScrollViewInsets = false –
根据其他研究,这是折旧tableViews:'self.contentInsetAdjustmentBehavior = .never'。也没有效果 –
要清楚:我有以前,只是现在试图设置'self.automaticallyAdjustsScrollViewInsets = false'。没有不同。相同的行为 –