我想将导航栏设置为背景black以及里面的所有颜色white.
所以,我使用了这段代码:
[[UINavigationBar appearance] setTitleTextAttributes:
[NSDictionary dictionaryWithObjectsAndKeys:
[UIColor whiteColor],
NSForegroundColorAttributeName,
[UIColor whiteColor],
NSForegroundColorAttributeName,
[NSValue valueWithUIOffset:UIOffsetMake(0, -1)],
NSForegroundColorAttributeName,
[UIFont fontWithName:@"Arial-Bold" size:0.0],
NSFontAttributeName,
nil]];
但后退按钮文字颜色, arrow and 栏按钮仍然默认蓝色.
如何更改这些颜色,如下图所示?
来自某些属性的行为UINavigationBar
已更改为iOS 7。您可以在下图中看到:
我想与您分享两个美丽的链接。欲了解更多详细信息,您可以通过以下链接:
-
iOS 7 UI 过渡指南.
-
如何为 iOS 7 更新您的应用.
苹果文档 for 条形颜色 says :
该颜色默认为半透明,除非您设置
半透明属性为NO。
示例代码:
self.navigationController.navigationBar.barTintColor = [UIColor blackColor];
self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
[self.navigationController.navigationBar
setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor whiteColor]}];
self.navigationController.navigationBar.translucent = NO;
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)