私のナビゲーションバーには、左右の位置に2つのボタンがあり、ナビゲーションタイトルにsegmentetControllビューがあります。ナビゲーションバーの背景色を黒に変更したいのですが、その中のアイテムの色が別の色になります。どうすればいいですか?ナビゲーションバーのtintColorを黒に変更しようとしています。しかし、segmentedControllとnavigationBarのボタンの色も黒に変わったことを示しています。
前もって感謝します。
私のナビゲーションバーには、左右の位置に2つのボタンがあり、ナビゲーションタイトルにsegmentetControllビューがあります。ナビゲーションバーの背景色を黒に変更したいのですが、その中のアイテムの色が別の色になります。どうすればいいですか?ナビゲーションバーのtintColorを黒に変更しようとしています。しかし、segmentedControllとnavigationBarのボタンの色も黒に変わったことを示しています。
前もって感謝します。
UINavigationController *_navigationController = [[UINavigationController alloc] initWithRootViewController: _viewController];
either this
_navigationController.navigationBar.tintColor = [UIColor blackColor];
OR
_navigationController.navigationBar.barStyle=UIBarStyleBlack;
Now about right and left buttons:
UIButton *btnLeft=[UIButton buttonWithType:UIButtonTypeCustom];
btnLeft.frame=CGRectMake(0.0, 5.0, 50.0, 30.0);
btnLeft.backgroundColor=[UIColor RedColor];
btnLeft.layer.borderColor=[UIColor whiteColor].CGColor;
btnLeft.titleLabel.textColor=[UIColor blackColor];
btnLeft.titleLabel.font=[UIFont boldSystemFontOfSize:10.0];
_navigationController.navigationItem.leftBarButtonItem=[[UIBarButtonItem alloc]initWithCustomView:btnLeft];
similary you can add right bar button
ナビゲーション バーに tintColor というプロパティがあります。その値を任意の色に設定できます。