1

ViewController A 推送到 ViewController B。

和 ViewController A :

self.navigationController.navigationBarHidden = YES;

但我不想隐藏 ViewController B 中的导航栏,

在 ViewController B 中:

self.navigationController.navigationBarHidden = NO;

但这不起作用,我怎样才能在 B 中显示导航栏?

先感谢您!

4

1 回答 1

3

//ViewControllerB.m

  -(void)viewWillAppear:(BOOL)animated{
        [self.navigationController setNavigationBarHidden:NO];
    }

//ViewControllerA.m

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

Remember Editor->Embed IN -> NavigationController for RootViewController in StoryBoard or init NavigationController in AppDelegate if use XIB

于 2013-03-08T04:14:12.653 回答