我有一个奇怪的问题。我有两个视图控制器。一个 homeViewController 和一个 settingViewController。
homeViewController 没有导航栏,而 settingViewController 有。
现在的问题是当我推动 settingViewController 并从中返回时,我的 homeViewController 视图的高度变小了。(视图的高度 - 导航栏高度)
(不想手动调整框架)
// homeViewController
-(void) settingButtonPressed {
SettingsViewController *svc = [[SettingsViewController alloc] init];
[self.navigationController pushViewController:svc animated:YES];
}
// settingViewController
-(void) viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
self.navigationController.navigationBarHidden = NO;
self.navigationController.navigationBar.barStyle = UIBarStyleDefault;
self.navigationItem.hidesBackButton = NO;
[UIApplication sharedApplication].statusBarHidden = YES;
UIInterfaceOrientation statusBarOrientation =[UIApplication sharedApplication].statusBarOrientation;
[self willAnimateRotationToInterfaceOrientation:statusBarOrientation duration:0.0];
}
-(void) viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
self.navigationController.navigationBarHidden = YES;
}
请建议解决它。