我有一个ViewController管理一个视图,我有一个表视图,一个ImageView和一个导航栏。 当我把它在横向模式下的导航栏不调整到32时,仍有44 我第一次尝试使用自动调整大小在IB没有成功,然后我试图把这个代码在视图控制器风景模式问题与导航栏
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)orientation duration:(NSTimeInterval)duration {
//[super willAnimateRotationToInterfaceOrientation:orientation duration:duration];
CGRect frame = self.navigationController.navigationBar.frame;
if (UIInterfaceOrientationIsPortrait(orientation)) {
frame.size.height = 44;
} else {
frame.size.height = 32;
}
self.navigationController.navigationBar.frame = frame;
}
但没有。 我该如何解决这个问题?
你需要在这个方法中调用super,它不应该被注释掉。 – titaniumdecoy 2012-03-27 20:41:47