無効な ImageShack リンクを削除
ご覧のとおり、変更する必要があるビューは、タブバーの順序をカスタマイズするために提供されたビューです。ナビゲーションバー(「設定」を意味する「コンフィグリレン」を表示)の色を変更したいのですが、「その他」のナビゲーションコントローラーの色を変更する方法はすでにわかりましたが、これはわかりません。誰でもそれを手伝ってもらえますか?
無効な ImageShack リンクを削除
ご覧のとおり、変更する必要があるビューは、タブバーの順序をカスタマイズするために提供されたビューです。ナビゲーションバー(「設定」を意味する「コンフィグリレン」を表示)の色を変更したいのですが、「その他」のナビゲーションコントローラーの色を変更する方法はすでにわかりましたが、これはわかりません。誰でもそれを手伝ってもらえますか?
あなたが探しているのはこれだと思います(通常はアプリデリゲートでナビゲーションコントローラーを作成するときに行う):
UINavigationController *navigationController;
...
navigationController.navigationBar.tintColor = [UIColor blackColor];
int AppDelegate を使用する
tabBarController.moreNavigationController.navigationBar.tintColor = [UIColor blackColor];
その確かに動作するつもりです!:-)
self.navigationController.navigationBar.tintColor = [UIColor blackColor];
簡単にすることができます (タブバーデリゲートで使用):
- (void)tabBarController:(UITabBarController *)tabBarController willBeginCustomizingViewControllers:(NSArray *)viewControllers {
id modalViewCtrl = [[[tabBarController view] subviews] objectAtIndex:1];
if([modalViewCtrl isKindOfClass:NSClassFromString(@"UITabBarCustomizeView")] == YES)
((UINavigationBar*)[[modalViewCtrl subviews] objectAtIndex:0]).tintColor = [UIColor redColor];
}
次のように、Configure NavBar の色を変更できました。
このメソッドを実装します。
-(void)beginCustomizingTabBar:(id)sender
{
[super beginCustomizingTabBar:sender];
// Get the new view inserted by the method called above
id modalViewCtrl = [[[self view] subviews] objectAtIndex:1];
if([modalViewCtrl isKindOfClass:NSClassFromString(@"UITabBarCustomizeView")] == YES)
{
UINavigationBar* navBar = [[modalViewCtrl subviews] objectAtIndex:0];
[navBar setBarStyle:UIBarStyleBlackTranslucent];
[navBar setTranslucent:YES];
}
}
標準色 (グレー、黒、白) を探している場合は、xCode 5 内でこれらの値を設定できます。ビュー コントローラー全体を選択し、属性インスペクターを選択します。属性の下に、「トップバー」の横にドロップダウンがあります。そこで、ナビゲーション バー コントローラーの色と不透明度のさまざまな設定を選択できます。
以下の概要は、いくつかのスクリーンショットです。お役に立てれば!