如何更改 UINavigationController 后退按钮名称? [英] How to change the UINavigationController back button name?
本文介绍了如何更改 UINavigationController 后退按钮名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个 UIViewController
并且我正在从我的第一个视图控制器导航到第二个视图控制器,我想更改 navigationcontroller
上显示的按钮的名称回去……
I have a UIViewController
and I'm navigating from my first view controller to second view controller and I want to change the name of the button shown on the navigationcontroller
for going back ....
SecondViewController *secondController = [[SecondViewController alloc]
initWithNibName:nil
bundle:NULL];
[self.navigationController pushViewController:secondController animated:YES];
现在在第二个 viewcontroller
我想更改 navigationController
中按钮的名称.
now in the second viewcontroller
I want change the name of the button in the navigationController
.
推荐答案
在 viewWillAppear 中写这个
In viewWillAppear write this
self.navigationItem.title = @"List View";
在 ViewWilldisapper 中写这个
And in ViewWilldisapper write this
self.navigationItem.title = @"Back";
无需故事板即可工作.
这篇关于如何更改 UINavigationController 后退按钮名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文