I have three devices with three iOS version. I hide the navigation bar in RootViewController
. Then for each ViewController
, I display the navigation bar as
- (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;
}
It works on two devices with iOS8.4 and iOS9.1, but not for iOS7.1. For the iOS7.1 device, if I change the segue to custom type, the navigation bar is displayed. But if I change to Show (Push) segue, the navigation bar doesn't show up. What could be the problem? I used segue from UIStoryBoard. Thanks