设置UINavigationBar的背景颜色无效吗? [英] Setting the background color of UINavigationBar has no effect?
本文介绍了设置UINavigationBar的背景颜色无效吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
对于大多数iOS小部件,我可以设置背景颜色.看来UINavigationBar不是这种方式. 此外,我无法设置导航项目(顶部项目)的背景,因为它不响应setBackgroundColor.
For most iOS widgets I can set the background color. It appears that UINavigationBar is not this way. Furthermore I cannot set the navigation item (top item)'s background as it does not respond to setBackgroundColor.
如何更改该颜色? 谢谢.
How can I change that color? Thanks.
推荐答案
您应改用setTintColor:
:
[self.navigationController.navigationBar setTintColor:[UIColor redColor]];
希望这会有所帮助!
这篇关于设置UINavigationBar的背景颜色无效吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文