更改导航栏颜色

Change navigation bartintcolor

选择"prefers large titles"时,导航栏TintColor不会改变。我尝试从 Attribute Inspector 和编程方式更改它。我可以在故事板中看到颜色变化,但在我 运行 应用程序时看不到。我对 titleColor 也有同样的问题。

是的,您需要将 navigationBarbackgroundColor 更改为 largeTitle 模式。它与 normalMode.

完全不同

有情节提要

有代码

navigationController?.navigationBar.backgroundColor = .brown

结果

注意上面的白色区域实际上是RootViewControllerbackgroundColor,需要手动处理

为每一个尝试不同的颜色并进行游戏以更好地理解行为