ナビゲーション コントローラーでは、コントローラーの向きは、ナビゲーション コントローラーのルート コントローラーの向きに依存します。
次の 2 つの可能性があります。
実際に表示されるコントローラーに応じて、ルート コントローラーがshouldAutorotateToInterfaceOrientation:
異なる値を返すようにします。
ビューコントローラーのビューで変換を使用して、回転させます。
最初の方法を試してみます。方法については、この投稿を参照してください (内容を無視するだけUITabBarController
です)。または、これを試してください (ナビゲーション階層の最上位のコントローラーにメッセージを中継するだけです)。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return [self.navigationController.topController shouldAutorotateToInterfaceOrientation:interfaceOrientation];
}
iOS6 で同じ結果を得るには、次のメソッドを試して定義してください。
-(NSUInteger)supportedInterfaceOrientations {
return [self.navigationController.topController supportedInterfaceOrientations];
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return [self.navigationController.topController preferredInterfaceOrientationForPresentation];
}