[[UITabBar appearance] setSelectedImageTintColor:[UIColor redColor]];
iOS7 で正常に動作しなくなったようです。背景画像を設定できますが、選択したテキストが赤色になりません。これをアプリケーション デリゲートから呼び出しています。UITabBar
iOS7でフォントの色とスタイルを設定しようとした人はいますか?
7349 次
3 に答える
4
それは私のために働いた..
[[UITabBar appearance] setBarTintColor:[UIColor blackColor]];
[[UITabBar appearance] setTintColor:[UIColor whiteColor]];
于 2014-01-21T15:06:22.597 に答える
3
それはtintColor
iOS7にあります。以下を試してください:
[[UITabBar appearance] setTintColor:[UIColor redColor]];
編集:
非アクティブなボタンに色を付けるには、次のコードを VC に追加しますviewDidLoad
。
[self.tabBarItem setFinishedSelectedImage:[UIImage imageNamed:@"item_seleted.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"item_unselected.png"]];
于 2013-09-16T13:25:09.443 に答える
2
アクティブでないアイテムに色を付けるには、これを使用しました
UITabBarItem *item = [self.tabBar.items objectAtIndex:1];
// here you need to use the icon with the color you want, as it will be rendered as it is
item.image = [[UIImage imageNamed:@"unselected.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
// this icon is used for selected tab and it will get tinted as defined in self.tabBar.tintColor
item.selectedImage = [UIImage imageNamed:@"selected.png"];
于 2013-10-29T17:12:33.180 に答える