縦向きのみのモード ビューを、現在のビューとして横向きモード ビューを持つナビゲーション コントローラーにプッシュする必要がある場合があります。
再実装したものの
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
しかし、それはまだランドスケープモードでビューをプッシュしています。次の方法も試しましたが、これでもうまくいきません。
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait animated:YES];
}
他の関連する質問を調べてみましたが、何も見つかりませんでした。
どうすればこれを解決できますか?
ありがとう!