导航栏不出现

NAvigation bar not appear

我想让我的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];

但在我的视图控制器中看不到任何内容。这段代码有什么问题?请帮我。 谢谢

截图

代码

[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];

所以,我猜,你的View背景是白色的,所以你看不到白色文字。

备注

navigationBar.titleTextAttributes

Display attributes for the bar’s title text.

navigationBar.tintColor

The tint color to apply to the navigation items and bar button items.

拾取导航控制器场景,然后拾取导航栏(见图片),然后从 showutilites> 属性检查器设置清晰的颜色,你也可以从这里更改标题颜色