隐藏导航栏的标题而不删除它

Ken*_*nzo 5 iphone

我有一个带图像背景的自定义导航栏.我想在背景上显示标题,但我需要在下一个视图中显示后退按钮的文本.

self.title=@"" 不会(自然地)在前一个标题的后退按钮中.

Ken*_*nzo 20

根据pheekicks的建议,我找到了一个提示:

UILabel *label = [[UILabel alloc] init];
self.navigationItem.titleView = label;
Run Code Online (Sandbox Code Playgroud)


Mon*_*ona 5

[[UINavigationBar appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor clearColor], UITextAttributeTextColor, [UIColor clearColor], UITextAttributeTextShadowColor,  nil]];
Run Code Online (Sandbox Code Playgroud)