UINavigationBar
仅当我在已经呈现的导航控制器上呈现导航控制器时才显示奇怪的行为。在我滚动之前,大标题不可见。它只显示大标题的空白空间。这就是我设置导航栏的方式。没有什么花哨!
注意下面的代码是在导航控制器的子类中编写的。
let appearance = UINavigationBarAppearance()
appearance.backgroundColor = UIColor.appNavBarColor()
appearance.titleTextAttributes = [NSAttributedString.Key.font : UIFont.boldSystemFont(ofSize: 17.0),
NSAttributedString.Key.foregroundColor : UIColor.white]
appearance.largeTitleTextAttributes = [NSAttributedString.Key.foregroundColor : UIColor.white]
navigationBar.standardAppearance = appearance
navigationBar.scrollEdgeAppearance = appearance
这就是它在演示时的显示方式UINavigationController
。