我想要使我的Navigationbar清晰的颜色。所以我在我的ViewDidLoad里试着这样做
self.navigationController.navigationBar.hidden=NO;
[self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
self.navigationController.navigationBar.shadowImage=[UIImage new];
self.navigationController.navigationBar.translucent=YES;
self.navigationController.navigationBar.topItem.titleView.tintColor=[UIColor blackColor];
self.navigationController.navigationBar.topItem.title=[lan GetConvertedLanguageString:@"My Profile"];
self.navigationController.navigationBar.titleTextAttributes = [NSDictionary dictionaryWithObject:[UIColor whiteColor] forKey:NSForegroundColorAttributeName];
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"backarrow"] style:UIBarButtonItemStylePlain target:self action:@selector(revealToggle :)];
[self.navigationController navigationBar].tintColor = [UIColor whiteColor];但在我的视图控制器里什么都看不见。这个密码有什么问题吗?请帮帮我。谢谢
发布于 2015-12-02 07:17:19
屏幕截图

代码
[self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
self.navigationController.navigationBar.shadowImage=[UIImage new];
self.navigationItem.title = @"1234";
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Left" style:UIBarButtonItemStylePlain target:nil action:nil];
self.navigationController.navigationBar.titleTextAttributes = [NSDictionary dictionaryWithObject:[UIColor whiteColor] forKey:NSForegroundColorAttributeName];
[self.navigationController navigationBar].tintColor = [UIColor whiteColor];所以,我想,你的背景是白色的,所以你看不到白色的文本。
备注
navigationBar.titleTextAttributes
显示条形图标题文本的属性。
navigationBar.tintColor
适用于导航项和条形按钮项的色调颜色。
https://stackoverflow.com/questions/34036492
复制相似问题