UINavigation控制器的后标题将忽略先前的标题 [英] UINavigation controller back title is ignores previous title
问题描述
我希望导航控制器以ios7的方式工作=显示先前的视图标题.
I would like my navigation controller to act the way that ios7 does = display the previous view title.
它并不总是对我有用
我有一个SettingViewController
:
- (void)viewDidLoad
{
self.navigationItem.title = NSLocalizedStringFromTableInBundle(@"account_settings", nil,[GeneralUtil getLangBundle],nil);
self.navigationController.navigationBar.translucent = NO;
[super viewDidLoad];
}
单击按钮时,将打开个人资料图片"视图控制器,如下所示:
When clicking on a button it opens the Profile Picture view controller like this:
UIViewController *vc = [[UIStoryboard profilePictureStoryBoard]instantiateInitialViewController];
[self.navigationController pushViewController:vc animated:YES];
个人资料图片已成功打开,但后退按钮的标题为Back
,而不是Settings View控制器(即设置")的标题.
可能是什么问题?
The profile picture is opened successfully but the title of the back button is Back
and not the title of the Settings View controller which is Settings.
What could be the problem?
推荐答案
后退"按钮会根据需要显示的标题长度在iOS 7中更改其文本.
The back button changes its text in iOS 7 depending on the length of the title it needs to display.
如果前一个ViewController的名称太长而无法容纳,它将直接说"Back".如果没有足够的空间可显示返回",它将仅显示箭头.
If the name of the previous viewcontroller is too long to fit, it will instead just say 'Back'. If there's not even enough room for 'Back', it will just show the arrow.
这篇关于UINavigation控制器的后标题将忽略先前的标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!