首页 > 解决方案 > Set color for all UINavigationBars

问题描述

I have an app with multiple UINavigationControllers. Now I want to set their background color to the same color. I wrote this into the application method of AppDelegate:

UINavigationBar.appearance().backgroundColor = UIColor.darkGray

The same statement for UITabBars works:

UITabBar.appearance().barTintColor = UIColor.darkGray

What is my mistake?

Thanks for your help!

标签: iosswiftuinavigationcontrolleruinavigationbaruicolor

解决方案


UINavigationBar.appearance().barTintColor = UIColor.darkGray一定是


推荐阅读