使用斯威夫特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'。沒有不同。相同的行爲 –