Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/117.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
导航栏没有';在iOS7.1中,不能使用show(push)segue显示_Ios_Objective C_Iphone_Segue_Uistoryboardsegue - Fatal编程技术网

导航栏没有';在iOS7.1中,不能使用show(push)segue显示

导航栏没有';在iOS7.1中,不能使用show(push)segue显示,ios,objective-c,iphone,segue,uistoryboardsegue,Ios,Objective C,Iphone,Segue,Uistoryboardsegue,我有三台带有三个iOS版本的设备。我将导航栏隐藏在RootViewController中。然后,对于每个ViewController,我将导航栏显示为 - (void)viewDidLoad { [super viewDidLoad]; self.view.userInteractionEnabled = YES; // Do any additional setup after loading the view. [self.navigationControll

我有三台带有三个iOS版本的设备。我将导航栏隐藏在
RootViewController
中。然后,对于每个
ViewController
,我将导航栏显示为

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.userInteractionEnabled = YES;
    // Do any additional setup after loading the view.
    [self.navigationController setNavigationBarHidden:NO];
    CGRect frame = CGRectMake(0, 0, 0, 44);
    UILabel *label = [[UILabel alloc] initWithFrame:frame];
    label.backgroundColor = [UIColor clearColor];
    label.font = [UIFont fontWithName:@"Helvetica-Bold" size:20.0];
    label.textAlignment = NSTextAlignmentCenter;
    label.textColor = [UIColor blackColor];
    label.text = @"Update Height";
    self.navigationItem.titleView = label;
}
它可以在iOS8.4和iOS9.1的两个设备上工作,但不适用于iOS7.1。对于iOS7.1设备,如果我将segue更改为自定义类型,则会显示导航栏。但是如果我改为显示(推送)序列,导航栏就不会显示。 有什么问题吗? 我用的是UIStoryBoard的segue。 谢谢

读一下,然后试试这个

 //hide on current view controller
  - (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [self.navigationController setNavigationBarHidden:YES animated:YES];
}

// show on next view controller
- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    [self.navigationController setNavigationBarHidden:NO animated:YES];
}

我试过了。还是一样。仍然隐藏着。所有其他设备都可以工作,只有iOS7.1的设备不能工作。那么,对我来说,上述功能在5个以上的项目中都可以正常运行,如果你愿意从appdelegate中删除隐藏的功能并添加基于视图控制器的导航控制器hiiden,那么肯定可以工作,另外还有一个选项,在iOS 7 basedI中尝试另一个,请注意,如果下一个ViewController从右侧弹出,导航栏仍会出现,但一旦下一个视图从底部弹出,导航栏就不会出现。区别是,ViewController从侧面和底部弹出。右侧表示您的导航处于按下状态,底部表示您在导航栏中的导航不显示,导航控制器的导航栏将仅显示该导航控制器包含的视图控制器。在这里,您将呈现一个模态视图。导航控制器不包含它。您确定导航栏未隐藏在情节提要上吗?