我有一個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