1

他のすべてのタブに完成した選択済みおよび未選択の画像を設定できますが、特別な「その他」項目には設定できません。

スクリーンショット

これどうやってするの?

現在のコードは次のとおりです。

[[UITabBar appearance] setTintColor:contrastColor];
[[UITabBarItem appearance] setTitleTextAttributes:@{UITextAttributeTextColor: contrastColor, UITextAttributeTextShadowOffset: [NSValue valueWithUIOffset:UIOffsetMake(0, 0)]} forState:UIControlStateSelected];
[[UITabBarItem appearance] setTitleTextAttributes:@{UITextAttributeTextColor: contrastColor, UITextAttributeTextShadowOffset: [NSValue valueWithUIOffset:UIOffsetMake(0, 0)]} forState:UIControlStateNormal];

contrastColorは白色で、バックエンド システムから配信されます。

4

2 に答える 2

0

これで試しましたか?

tabBarController.tabBar.barTintColor = yourBarColor;

tabBarController.tabBar.tintColor = yourSelectedIconAndTextColor;

そして、さまざまな状態の場合:

[[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName:[UIFont fontWithName:yourFontName size:yourFontSize], NSForegroundColorAttributeName: yourSelectedIconAndTextColor} forState:UIControlStateSelected];

[[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName : [UIFont fontWithName:yourFontName size:yourFontSize], NSForegroundColorAttributeName:[UIColor defaultColor]} forState:UIControlStateNormal];

それが役に立てば幸い!

于 2013-10-23T12:07:53.013 に答える