首先,咱们要搞清楚info.plist中 View controller-based status bar appearance这个属性 View controller-based status bar appearance =NO 这个设置为:View Controller 不对status Bar 显示进行操做app
而后在viewcontroller里面修改navigationbar的颜色 [[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:65/255.0 green:159/255.0 blue:252/255.0 alpha:0.5]];代理
官方给出的意思 To customize the appearance of all instances of a class, send the relevant appearance modification messages to the appearance proxy for the class.(自定义的一个类的全部实例的外观,发送相关信息到外观的外观的代理类)For example, to modify the bar tint color for all UINavigationBar instances:code
[[UINavigationBar appearance] setBarTintColor:myColor];
这样就搞定了,哈哈图片
这里还能够特定容器类的选项: 官方定义: To customize the appearances for instances of a class contained within an instance of a container class:it
[[UINavigationBar appearanceWhenContainedIn:[UISplitViewController class], nil] setBarTintColor:myColor]; [[UINavigationBar appearanceWhenContainedIn:[UITabBarController class], [UISplitViewController class], nil] setBarTintColor:myTabbedNavBarColor];io