我有三個iOS版本的設備。我隱藏導航欄RootViewController
。然後,對於每個ViewController
,我顯示導航欄作爲導航欄不會出現在iOS7.1中使用show(push)segue
- (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更改爲自定義類型,則會顯示導航欄。但如果我更改爲顯示(推)segue,導航欄不顯示。 可能是什麼問題? 我從UIStoryBoard使用segue。 感謝
[Rü確保導航欄上沒有的故事板製作隱藏? –