2

SDK 6.1,目标 6.1,使用情节提要

aView有一个UIButton。我使用动作 segue [push] 到bView

当我单击此按钮时,按下bView即可

但是我popaView有一个回吧,我该如何解决这个问题?

视图.m

-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [self.navigationController.navigationBar setHidden:YES];
}

bView.m

-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [self.navigationController.navigationBar setHidden:NO];
}
4

1 回答 1

1

我知道你有什么问题。您将导航栏隐藏在viewWillAppear:方法中,viewA并且您在没有动画的情况下进行操作。

试试这个

// This will add an animation like slide out. So you may won't like it.
[self.navigationController setNavigationBarHidden:YES animated:YES];

如果它不起作用,则在 bView.m 中添加此代码

- (void)viewWillDisappear:(BOOL)animated {
[self.navigationController setNavigationBarHidden:YES animated:NO];
[super viewWillDisappear:animated]
}
于 2013-08-05T16:58:59.890 回答