使用Swift 3和Xcode 9,我正在使用大型的UINavigationBar
视图:
if #available(iOS 11.0, *) {
navigationBar?.prefersLargeTitles = true
UINavigationBar.appearance().largeTitleTextAttributes = [
NSForegroundColorAttributeName: Colors.black
]
}
当我滚动
UITableView
时,条形菜单折叠得太快,导致出现不必要的空间:之前的样子:
![enter image description here](https://istack.dev59.com/F42XI.webp)
![enter image description here](https://istack.dev59.com/MVE97.webp)
UITableView
就会出现菜单折叠。
UITableView
具有以下属性: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
}
这个条形图是半透明的,我希望保留这个效果。我缺少什么?非常感谢您的帮助。
self.contentInsetAdjustmentBehavior = .never
。而且,没有任何效果。 - David Seekself.automaticallyAdjustsScrollViewInsets = false
,但没有任何区别。行为相同。 - David Seek