ios 标签栏项目色调颜色
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21361101/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Tab bar item tint color
提问by Reza Safari
In iOS 7, I been developing an app that uses the UITabBarController and I noticed that the tab bar items stay gray even tho I change the tint color of the tab bar. Is there any way to change the color of non-selected tab bar items?
在 iOS 7 中,我一直在开发一个使用 UITabBarController 的应用程序,我注意到即使我更改了标签栏的色调,标签栏项目仍然保持灰色。有什么办法可以改变未选中的标签栏项目的颜色吗?
采纳答案by Balram Tiwari
回答by Iya
To sets the tint color globally for the app, you need to add below code In app delegate didFinishLaunchingWithOptions: method
:
要为应用程序全局设置色调颜色,您需要在应用程序中添加以下代码delegate didFinishLaunchingWithOptions: method
:
[[UITabBar appearance] setTintColor:[UIColor colorWithRed:13.0/255.0 green:116.0/255.0 blue:128.0/255.0 alpha:1.0]];