如何更改UINavigationController后退按钮名称? [英] How to change the UINavigationController back button name?

查看:92
本文介绍了如何更改UINavigationController后退按钮名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 UIViewController ,我正在从我的第一个视图控制器导航到第二个视图控制器,我想更改<$ c上显示的按钮的名称$ c> 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆