【发布时间】:2015-11-07 12:22:28
【问题描述】:
我有三个设备,三个 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 更改为自定义类型,则会显示导航栏。但是如果我更改为 Show (Push) segue,导航栏就不会出现。 可能是什么问题呢? 我使用了 UIStoryBoard 的 segue。 谢谢
【问题讨论】:
-
你确定导航栏没有隐藏在故事板上吗?
标签: ios objective-c iphone segue uistoryboardsegue