“标题”的问题在 UINavigationController 中
我的标题和 UINavigationController 遇到问题。我在 UIViewControllerCurrent 使用以下代码,当我从 NextViewController 返回时,导航栏的标题仍然是“上一个”..任何人都可以帮我解决这个问题吗?谢谢。
[self setTitle:@"Previous"];
NextViewController *controller = [[NextViewController alloc] init];
[[self navigationController] pushViewController:controller animated:YES];
[controller release], controller = nil;
- (void)viewWillAppear:(BOOL)animated; {
[self setTitle:@"Real Title"];
[super viewWillAppear:animated]; }
I am having a problem with title and UINavigationController. I am using the following code at UIViewControllerCurrent and when I get back from NextViewController, the title of the NavBar is still "Previous" ..Can anyone kindly help me out with this problem ? Thanks.
[self setTitle:@"Previous"];
NextViewController *controller = [[NextViewController alloc] init];
[[self navigationController] pushViewController:controller animated:YES];
[controller release], controller = nil;
- (void)viewWillAppear:(BOOL)animated; {
[self setTitle:@"Real Title"];
[super viewWillAppear:animated]; }
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我会尝试交换这两行,
以便您得到
,我会将它们放入 viewDidAppear 中。
I would try to exchange the two lines
so that you get
and I would put these into viewDidAppear.
尝试使用下面的 UINavigationController 委托方法。
使用委托方法之一来更改标题。
Try using UINavigationController delegate methods below.
Use one of the delegate method to change title.
如果 dasdoms 解决方案不起作用,请尝试以下操作。
在弹出之前的 NextViewController 中运行此代码。
If dasdoms solution is not working the try the following.
In the NextViewController just before poping out run this code.