如何在iOS 7中更改导航栏颜色?
基本上我想要实现像Twitter Nav Bar这样的东西(更新的Twitter iOS7就是这样).我嵌入了一个导航栏view controller.我想要的是将导航栏颜色更改为浅蓝色以及顶部的实用工具栏.我似乎找不到我的选择storyboard.
我尝试在iOS 7中使用导航栏颜色设置为黑色
[self.navigationController.navigationBar setTintColor:[UIColor blackColor]];
Run Code Online (Sandbox Code Playgroud)
用这个不起作用
但有些时候有效但所有其他条形按钮都保持黑色,这导致无法看到条形按钮
我只需要在某些特定视图上更改导航栏的颜色。关于修改导航栏颜色的讨论很多,比如/sf/answers/1320936361/,但它们都在同一导航层次结构下的每个视图上更改导航栏的颜色。
我想更改特定视图的颜色并使其他视图保持相同的颜色。我如何实现这一目标?
我UINAvigatoinBar用十六进制颜色设置我的颜色:
self.navigationController.navigationBar.barTintColor = UIColorFromRGB(0x212121);
Run Code Online (Sandbox Code Playgroud)
它运行良好,IOS7但在较低版本中崩溃与以下:
[UINavigationBar setBarTintColor:]: unrecognized selector sent to instance
Run Code Online (Sandbox Code Playgroud)
我该怎么办?