简体   繁体   English

如何在新的Xcode版本6.0.1中从Storyboard更改选项卡栏图标的颜色或文本颜色?

[英]How to change Tab Bar icon color or text color from Storyboard in new Xcode version 6.0.1?

How to change Tab Bar icon color or text color from the storyboard in new Xcode version 6.0.1? 如何在新的Xcode版本6.0.1中从情节提要中更改选项卡栏图标的颜色或文本颜色?

Here's a picture to illustrate what I have now: 这是一张说明我现在所拥有的照片:

X

My icon color is black if you can see: 如果看到以下内容,我的图标颜色为黑色:

X

I want to change the icon and the text color in the way I want from the storyboard, if it is possible. 如果可能的话,我想通过情节提要中的方式更改图标和文本颜色。

Try this, i have done it through code 试试这个,我已经通过代码做到了

To change selected Icon color: 更改所选图标的颜色:

[_tabController.tabBar setSelectedImageTintColor:[UIColor whiteColor]];

To change Text Color: 更改文本颜色:

[[UITabBarItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName :[UIColor yellowColor],NSFontAttributeName:[UIFont fontWithName:@"Roboto-Medium" size:11.0]} forState:UIControlStateNormal];

[[UITabBarItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName :[UIColor whiteColor],NSFontAttributeName:[UIFont fontWithName:@"Roboto-Medium" size:11.0]} forState:UIControlStateSelected];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM